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

ListBoxSelectionMode = MultiExtended and Del

Thread ID:

Created:

Updated:

Platform:

Replies:

30602 Jun 21,2005 07:09 AM UTC Jun 21,2005 10:19 AM UTC WinForms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 21, 2005 07:09 AM UTC

My problem is that if I set ListBoxSelectionMode = MultiExtended on my GridControl and I select a cell in a row, pressing Del cleares the whole row. However, pasting text from the clipboard worx well, t.i. only the currently selected cell gets modified. If no current cell available (I select the whole row by clicking on the row header), only then pasting overwrites each cell in the row. Workaround?

Administrator [Syncfusion]
Replied On June 21, 2005 08:12 AM UTC

Exactly what is the behavior you want to see that you do not see now?

Administrator [Syncfusion]
Replied On June 21, 2005 08:22 AM UTC

If you do not want to clear rows, then you can handle the ClearingCells event and set e.Handled = true, doing nothing in this case.
private void gridControl1_ClearingCells(object sender, GridClearingCellsEventArgs e)
{
	if(e.RangeList.ActiveRange.IsRows)
		e.Handled = true;
}
 

Administrator [Syncfusion]
Replied On June 21, 2005 08:43 AM UTC

I simply want the following if I press Del: If no currentcell exists, then delete each cell in the selection. (This is, when I select a row clicking on the row header.) If there is a currentcell, then only the contents of that cell get deleted.

Administrator [Syncfusion]
Replied On June 21, 2005 09:12 AM UTC

OK, now I can see your point: there''s always a currentcell: if I select the row clicking on the row header, then the header cell will be the currentcell. So, I use the ClearingCell event.

Administrator [Syncfusion]
Replied On June 21, 2005 10:19 AM UTC

I think this event handler will do what you described.
private void gridControl1_ClearingCells(object sender, GridClearingCellsEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(cc.ColIndex > 0 && !cc.IsEditing)
	{
		this.gridControl1[cc.RowIndex, cc.ColIndex].CellValue = null;
		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.

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

;