This is a migrated thread and some comments may be shown as answers.

How to Hide Id in Edit Form mode ?

2 Answers 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Liu
Top achievements
Rank 1
Liu asked on 28 Nov 2016, 11:27 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 28 Nov 2016, 01:06 PM
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.
0
Liu
Top achievements
Rank 1
answered on 28 Nov 2016, 07:35 PM
thanks, it work to me !
Tags
Grid
Asked by
Liu
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Liu
Top achievements
Rank 1
Share this question
or