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.

Best way to delete a row from a Grid (Unbound)

Thread ID:

Created:

Updated:

Platform:

Replies:

25154 Feb 19,2005 11:26 PM Feb 20,2005 07:15 AM Windows Forms 1
loading
Tags: GridControl
Nick Zdunic
Asked On February 19, 2005 11:26 PM

I want to be able to remove a row from the grid by selecting it and pressing the delete the key. Currently the behaviour is to make the cells in the row blank. What is the best way to do this? Should I capture the Delete KeyPress?

Administrator [Syncfusion]
Replied On February 20, 2005 07:15 AM

One way you can do this is to handle the ClearingCells event and remove the row there.
private void gridControl1_ClearingCells(object sender, GridClearingCellsEventArgs e)
{
	GridRangeInfo range = e.RangeList.ActiveRange;
	if(range.IsRows)
	{
		this.gridControl1.Rows.RemoveRange(range.Top, range.Bottom);
		e.Handled = true;
		e.Result = 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.

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.

;