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

How to remove Selected Rows from GridGrouping Control?

Thread ID:

Created:

Updated:

Platform:

Replies:

78807 Jan 1,2009 01:54 PM UTC Jan 6,2009 07:29 AM UTC Windows Forms 6
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 1, 2009 01:54 PM UTC

I want to remvoe selected rows from gridgrouping control. I need the C# Code for that. I used earlier codes given in this forum for the same but none of them worked. My Datasource for this gridgrouping control is Array List. Thanks


Jisha Joy [Syncfusion]
Replied On January 2, 2009 05:58 AM UTC

Hi Vignesh,

The following code snippet helps you to remove the selected records from the GridGroupingControl. Please try it and let us know if you need any further assistance.

Syncfusion.Grouping.SelectedRecordsCollection selRecords;
selRecords = this.gridGroupingControl1.Table.SelectedRecords;
foreach(Syncfusion.Grouping.SelectedRecord record in selRecords)
{
record.Record.Delete();
}


Also refer to the following forum thread for more details on this issue
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=36978

Regards,
Jisha


Administrator [Syncfusion]
Replied On January 2, 2009 06:57 AM UTC

Basically After using this code what happenes is still not data are removed from the grid. but If i Select the row then on the selected row i see values of the row following next to it. I am missing few properties i guess. I tried using Beginedit and End edit but that did not gave results.
>Hi Vignesh,

The following code snippet helps you to remove the selected records from the GridGroupingControl. Please try it and let us know if you need any further assistance.

Syncfusion.Grouping.SelectedRecordsCollection selRecords;
selRecords = this.gridGroupingControl1.Table.SelectedRecords;
foreach(Syncfusion.Grouping.SelectedRecord record in selRecords)
{
record.Record.Delete();
}


Also refer to the following forum thread for more details on this issue
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=36978

Regards,
Jisha




Administrator [Syncfusion]
Replied On January 2, 2009 07:02 AM UTC


Has This problem of data source not getting refreshed to do with Array List?

My data source is of type Array List.


Administrator [Syncfusion]
Replied On January 2, 2009 09:29 AM UTC

Okay I have added this code finally.
this.gridGroupingControl1.Engine.Table.TableDirty = true;
So the problem of row not removing is solved But a new bug I have seen is that If i remove rows 1,2,3 then Rows 2,5,6 etc. i.e. rows which were not selected are deleted. at runtime values inside the records is changing when we start deleting rows in a loop. How can we stop this happening?




Administrator [Syncfusion]
Replied On January 2, 2009 09:43 AM UTC


Okay I have came up with the solution itself.

You can use the following code to remove selected rows from a GRID GROUPING CONTROL.

Syncfusion.Grouping.SelectedRecordsCollection selRecords;
selRecords = this.gridGroupingControl1.Table.SelectedRecords;
Syncfusion.Grouping.Record[] r = new Record[count];
selRecords.CopyTo(r, 0);
this.gridGroupingControl1.Table.SelectedRecords.Clear();

this.gridGroupingControl1.Engine.Table.BeginEdit();

for (int i = count - 1; i >= 0; i--)
{
this.gridGroupingControl1.Table.DeleteRecord(r[i]);
}


this.gridGroupingControl1.Engine.Table.EndEdit();
this.gridGroupingControl1.Engine.Table.TableDirty = true;
this.gridGroupingControl1.Update();

The idea for going to delete records in a reverse direction is that even if records change we will always ensure that correct selected row is deleted.
Thank you.


Jisha Joy [Syncfusion]
Replied On January 6, 2009 07:29 AM UTC

Hi Vignesh,

Glad to hear that issue has been solved. Thank you for sharing information with us.

Regards,
Jisha


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

;