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.

select rows, cell and delete

Thread ID:

Created:

Updated:

Platform:

Replies:

12761 Apr 12,2004 03:10 AM Apr 13,2004 07:15 PM Windows Forms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On April 12, 2004 03:10 AM

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 04:17 AM

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 06:15 PM

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 02:02 AM

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 06:27 PM

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 07:15 PM

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

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.

;