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

Making AutoGeneratedColumns not editable

1 Answer 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 27 Sep 2010, 09:15 PM
I want to make the first auto generated column in my grid not editable when in edit/insert mode but 
AutoGeneratedColumns[0].IsEditable is read only.  I've tried removing the table row that contain the form controls during the item created event but that causes a casting error further down the event chain.  Can I do what I want here and if so what's the easiest way to do it?  Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 27 Sep 2010, 09:33 PM
Hello Jay,

Please try the following approach:
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
{
    if (e.Column.UniqueName == "UnitPrice")
    {
        (e.Column as GridBoundColumn).ReadOnly = true;
    }
}

I hope this helps.

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Jay
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or