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

Adding value to cell in readonly column in grid associated with dataset

1 Answer 31 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jorge Gonzalez
Top achievements
Rank 1
Jorge Gonzalez asked on 21 Dec 2009, 05:08 AM
FYI,
    The first column of my grid is readonly. I needed to programmatically  add a value to a cell in this column. This is how to do it:

<data table>.Columns[<column index>].ReadOnly = false;

<data table>.Rows[<row index>][<column index>] = <value>;

<data table>.Columns[<column index>].ReadOnly = false;

column index is 0 for me.

1 Answer, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 22 Dec 2009, 03:08 PM
Hi Jorge Gonzalez,

Generally DataTable object does not implement INotify Property and Collection changed events. In order to have immediate UI response when underlying data is changed, you can use DataTable.DefaultView, otherwise you have to call RadGridView.Rebind() on every data change.

P.S. GridViewColumn.IsReadOnly property prevents users to edit data. There is no limitation when you change data from the code behind (just data object have to implement INotify ... changed events).

Sincerely yours,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Jorge Gonzalez
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Share this question
or