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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

34157 Sep 5,2005 06:42 AM UTC Sep 5,2005 09:51 AM UTC Windows Forms 4
loading
Tags: GridControl
prathima venkobachar
Asked On September 5, 2005 06:42 AM UTC

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

prathima venkobachar
Replied On September 5, 2005 07:08 AM UTC


Administrator [Syncfusion]
Replied On 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();

prathima venkobachar
Replied On 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

Administrator [Syncfusion]
Replied On 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;
 

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;