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

How to update the records in the RadGridView for winforms

3 Answers 233 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mahesh
Top achievements
Rank 1
Mahesh asked on 13 Sep 2007, 12:06 PM
how to update multiple records in a RadGridView for winforms.

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 13 Sep 2007, 04:58 PM
Hi Mahesh,

If you wish to modify multiple records in RadGridVIew you should enclose this process between the calls to GridTableElement.BeginUpdate and GridTableElement.EndUpdate. See this sample code:

this.radGridView.GridElement.BeginUpdate();

for (int i=0; i<10; i++)
{
    this.radGridView.Rows[i].Cells[1].Value = i;
    this.radGridView.Rows[i].Cells[2].Value = "modified";
}

this.radGridView.GridElement.EndUpdate(true);

Sincerely yours,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mahesh
Top achievements
Rank 1
answered on 14 Sep 2007, 05:48 AM
Thanks for your reply.
           But my problem is in my grid i have 2 bool (checkbox) columns.i have a RadButton in my form.I update(check or uncheck ) in multiple records . After that i click the RadButton. In that click event i iterate the records in the gridview like

GridViewInfo gvi = radGridView1.MasterGridViewInfo;

int Rowcount = gvi.Rows.Count;

for (int i = 0; i < Rowcount; i++)

{

GridViewRowInfo gvri = gvi.Rows[i];

bool publish = (bool)gvri.Cells["Publish"].Value;

bool Active = (bool)gvri.Cells["Active"].Value;

}

but i did not get the last cell updated value?

Thanks in Advance,
Mahesh

0
Georgi
Telerik team
answered on 16 Sep 2007, 10:40 AM
Hello Mahesh,

This is caused by a know issue. Pleas, see the following forum post: http://www.telerik.com/community/forums/thread/b311D-ca.aspx

 
Sincerely yours,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Mahesh
Top achievements
Rank 1
Answers by
Jack
Telerik team
Mahesh
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or