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

Iterating through all the cells in a DataGrid programmatically.

3 Answers 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 05 Sep 2008, 05:10 PM
I tried this code to iterate through all the cells in the datagrid to change its property
but it only changes the last row. What I'm I doing wrong?
 
 protected void Page_PreRender(object sender, EventArgs e)
    {
        foreach (GridDataItem item in RadGrid1.Items)
        {
            item.Edit = true;
        }
        RadGrid1.Rebind();
    }


Thanks,

3 Answers, 1 is accepted

Sort by
0
Vladimir
Top achievements
Rank 1
answered on 05 Sep 2008, 06:52 PM
You may need to set AllowMultiRowEdit to true.
0
Jerry
Top achievements
Rank 1
answered on 05 Sep 2008, 07:33 PM
Thank you, That worked.
0
Shinu
Top achievements
Rank 1
answered on 08 Sep 2008, 06:23 AM
Hi Jerry,

You can also go through the following help article which shows how to set the entire Grid in edit mode without rebind.
Put all items in edit mode without additional rebind

Thanks
Shinu.
Tags
Grid
Asked by
Jerry
Top achievements
Rank 1
Answers by
Vladimir
Top achievements
Rank 1
Jerry
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Share this question
or