I would like to know how can I easily cus开发者_高级运维tomize my detailsView that when it is in Create mode ID field should be invisible
I can rememebr that it was sth like visible = <% code here ... (IsCreated ??)
here is an example:
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="myDS"
Width="50%" DataKeyNames="MyId">
<Fields>
<asp:TemplateField HeaderText="Id" SortExpression="MyId">
<ItemTemplate>
<asp:Label ID="xxx" runat="server" Text='<%# Bind("MyId") visible=" **(if create mode than invisible else visible)** %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
thanks for help
Try:
Visible="<%# this.IsCreated %>"
精彩评论