How to Hide Id in Edit Form mode ?

3 posts, 1 answers
  1. Liu
    Liu avatar
    14 posts
    Member since:
    May 2014

    Posted 28 Nov 2016 Link to this post

    Hi: Here are a part of RadGrid ! when I in edit & insert mode, I want hide Id (because it PK and auto increment), How Can I do ?

    <Columns>
    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
    </telerik:GridEditCommandColumn>

    <telerik:GridBoundColumn DataField="Id" HeaderText="Id" SortExpression="Id"
    UniqueName="Id" Visible="false" >
    </telerik:GridBoundColumn>

    <telerik:GridBoundColumn DataField="Catagory" HeaderText="題目類別" SortExpression="Catagory"
    UniqueName="Catagory">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="CataPercentage" HeaderText="百分比" SortExpression="CataPercentage"
    UniqueName="CataPercentage">

    </telerik:GridBoundColumn>
    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" />
                    </Columns>

  2. Answer
    Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 28 Nov 2016 Link to this post

    Hello,

    You can set the ReadOnly property of the column to "true" in order to remove it form the rendered edit form:
    <telerik:GridBoundColumn DataField="ID" ReadOnly="true" ></telerik:GridBoundColumn>

    If you need to disable the editor to be rendered in Insert mode only, you can use the InsertVisibilityMode:
    <telerik:GridBoundColumn DataField="ID" InsertVisiblityMode="AlwaysHidden" ></telerik:GridBoundColumn>

    Hope this help.


    Regards,
    Konstantin Dikov
    Telerik by Progress
    Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
  3. Liu
    Liu avatar
    14 posts
    Member since:
    May 2014

    Posted 28 Nov 2016 in reply to Konstantin Dikov Link to this post

    thanks, it work to me !
Back to Top