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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGroupingControl: Remove row button.

Thread ID:

Created:

Updated:

Platform:

Replies:

15586 Jun 23,2004 05:54 AM UTC Aug 4,2004 03:33 PM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 23, 2004 05:54 AM UTC

Hello. How to implement remove row button on the form. Just to delete currently selected row by pressing this button. Thank you.

Administrator [Syncfusion]
Replied On June 23, 2004 08:40 AM UTC

You can Record.Delete to remove a record from a GridGrouping control. So, for example, to delete the current record in a GridGroupingControl, you could use code like
private void button1_Click(object sender, EventArgs e)
{
	Record r = this.gridGroupingControl1.Table.CurrentRecord;
	if(r != null)
	{
		r.Delete();
	}
}

Gerald Stedile
Replied On August 4, 2004 01:37 PM UTC

Hi Clay, I am actually using some code like this. The only difference is, that I do not only delete the current row, but loop over all the existing rows to delete them. If there is more than one row in the list I get an Exception from the GridGroupingControl when deleting the first row. Is there some known workaround ? Greetings, Gary

Administrator [Syncfusion]
Replied On August 4, 2004 03:33 PM UTC

I tried this code by clicking on the last line an dthen clicking th ebutton. It deleted everything for me using 2.0.5.1.
private void button1_Click(object sender, System.EventArgs e)
{
	Record r = this.gridGroupingControl1.Table.CurrentRecord;
	while(r != null)
	{
		r.Delete();
	this.gridGroupingControl1.Table.TableDirty = true;
	this.gridGroupingControl1.Refresh();
	r = this.gridGroupingControl1.Table.CurrentRecord; 
	}
}

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

;