开发者

Make ID field invisible in detailsView

开发者 https://www.devze.com 2023-01-18 17:37 出处:网络
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 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 %>"
0

精彩评论

暂无评论...
验证码 换一张
取 消