We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Not able to get correct GetChanges() when I use F3 and F4 keys in gridGroupingControl

Hi, I am using gridGroupingControl.I am using F3 and F4 keys to select and deslect the records in the grid. I select 5 rows using f3 key.On button click I call GetChnages().It gives me row count as 4. I am sending the application replicating the problem. Thanks, Prathima

4 Replies

PV prathima venkobachar September 5, 2005 07:08 AM UTC



AD Administrator Syncfusion Team September 5, 2005 07:58 AM UTC

Try calling BeginEdit on the record before you change it and EndEdit on the record after you change it. You would do this for both F3 and F4. r.ParentRecord.BeginEdit(); r.ParentRecord.SetValue("boolCol", true); r.ParentRecord.EndEdit();


PV prathima venkobachar September 5, 2005 09:00 AM UTC

Thanks for the reply.This works fine. But my concern is BeginEdit() and EndEdit() will take more time. If I had selected 1000 recs and do F3 and F4 then the application will be very slow. Any solution for this..? Thanks, Prathima


AD Administrator Syncfusion Team September 5, 2005 09:51 AM UTC

You can try making the changes directly on the underlying data source and not go through the grid to make the changes. This way, you will avoid all the grid events that accompany changes.
this.gridGroupingControl1.BeginUpdate();
foreach(GridRangeInfo range in this.gridGroupingControl1.TableModel.Selections.Ranges) {
	for(int i = range.Top; i <= range.Bottom; ++ i) {
		GridRecordRow r = this.gridGroupingControl1.Table.DisplayElements[i] as GridRecordRow;
		int index = this.gridGroupingControl1.Table.Records.IndexOf(r.ParentRecord);
		dt.Rows[index]["boolCol"] = true;
	}
}
this.gridGroupingControl1.EndUpdate(true);
e.Inner.Handled = true;

            

Loader.
Live Chat Icon For mobile
Up arrow icon