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.

Deleting rows in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

25483 Feb 28,2005 11:42 AM Mar 1,2005 04:48 AM Windows Forms 2
loading
Tags: GridControl
Lamy
Asked On February 28, 2005 11:42 AM

Hi, I want to be able to delete the selected rows in a GridControl when user clicks on DELETE key. The default action of the grid is to clear the rows (and keep empty rows instead). Instead of having empty rows, I would like to be able to delete the rows so that I would not have "gaps" of empty rows between the rows of my grid. I tried to catch the following events : gridControl.RowsRemoving gridControl.RowsRemoved But the DELETE key does not seem to trigger any of theese events... Thanks Ams

Administrator [Syncfusion]
Replied On February 28, 2005 12:12 PM

Try handling the ClearingCells event. private void grid_ClearingCells(object sender, GridClearingCellsEventArgs e) { GridRangeInfo range = e.RangeList.ActiveRange; if(range.IsRows) { this..Rows.RemoveRange(range.Top, range.Bottom); e.Handled = true; } }

Lamy
Replied On March 1, 2005 04:48 AM

Great ! Thank you. >Try handling the ClearingCells event. > >private void grid_ClearingCells(object sender, GridClearingCellsEventArgs e) >{ > GridRangeInfo range = e.RangeList.ActiveRange; > if(range.IsRows) > { > this..Rows.RemoveRange(range.Top, range.Bottom); > e.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.

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.

;