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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

select rows, cell and delete

Thread ID:





12761 Apr 12,2004 07:10 AM UTC Apr 13,2004 11:15 PM UTC WinForms 5
Tags: GridControl
Administrator [Syncfusion]
Asked On April 12, 2004 07:10 AM UTC

Hi, I have a problem with select and delete rows,cell. I want to MultiSel in GridDataBoundGrid, and while click cell,it will hilight the cell and clean the cellvalue if press del key, only click the row header can delete the selected rows. in order to multisel, i set grid.ListBoxSelectionMode = SelectionMode.MultiExtended, but in this way,while click cell,it will select a row other than the current cell,and will delete the row if press the del key. then,i set grid.AllowSelection = GridSelectionFlags.Any & (~GridSelectionFlags.Row) but it doesn''t work well. please help me. Thanks!

Administrator [Syncfusion]
Replied On April 12, 2004 08:17 AM UTC

I am not sure what is the exact behavior you want. If you do not want to delete the whole row if you have an active currentcell, then you can handle this in RowsDeleting. You could just cancel it, but if you want the delete key to delete the text then you would have to do a little more work. private void gridDataBoundGrid1_RowsDeleting(object sender, GridRowRangeEventArgs e) { if(this.grid.CurrentCell.IsEditing) { e.Cancel = true; GridTextBoxControl tb = this.grid.CurrentCell.Renderer.Control as GridTextBoxControl; if(tb.SelectionLength == 0) tb.SelectionLength = 1; tb.SelectedText = ""; } }

Administrator [Syncfusion]
Replied On April 12, 2004 10:15 PM UTC

hi,clay my expression is not very clear. my purpose is want to multisel the rows in the GDBG,and i want this happens only while click on row header,and do not select the whole row while click a cell. how could i do?

Administrator [Syncfusion]
Replied On April 13, 2004 06:02 AM UTC

Try turning off grid.ListBoxSelectionMode. Otherwise, clicking on the any cell will select any row. And in the grid.AllowSelection property, turn off the Column and Cell flags. I think this should only allow you to select rows by clicking/drag-selecting the headers.

Administrator [Syncfusion]
Replied On April 13, 2004 10:27 PM UTC

hi, clay But if I turn off grid.ListBoxSelectionMode, the grid can not multiselrows by shift or ctrl key. I set grid.AllowSelection,but it doesn''t work on multisel mode. why? How should I do?

Administrator [Syncfusion]
Replied On April 13, 2004 11:15 PM UTC

I find my mistakes, and correct it. Thanks a lot!


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon