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

Multi Selection GridDataBoundGrid

HI, in GridDataBoundGrid i need Selection mode be MultiSimple (to selecction always with me) but in the same way like MultiExtended to multi select by mouse and SHIFT, CTRL, and arrow keys to make selections. any way to do that. thanks.

3 Replies

AD Administrator Syncfusion Team April 12, 2005 07:14 AM

There are no property settings that will do this for you. You will have to try to code this yourself. You might be able to handle the SelectionChanging event and try to manage the behvior at this point. You could try setting the SelectionMode to MultiSelect. Then in SelectionChanging, when e.Range is empty, the grid is requesting that all selections be cleared. At this point, you can cancel this selection clearing by set e.Cancel = true. You can try explicitly selecting and unselecting rows. I suspect this will take some coding to implement.


SU Subhash April 19, 2005 07:12 AM

Hi Clay Does that mean we can not select multiple rows in GridDataBoundGrid by any means, as there does not seem to be any event as "SelectionChanging", and GridDataBoundGrid does not support a Select Datagrid.(rowindex) like conventional methods ? (I''m using the version 1.6 ). Regards, Subhash >There are no property settings that will do this for you. You will have to try to code this yourself. You might be able to handle the SelectionChanging event and try to manage the behvior at this point. You could try setting the SelectionMode to MultiSelect. Then in SelectionChanging, when e.Range is empty, the grid is requesting that all selections be cleared. At this point, you can cancel this selection clearing by set e.Cancel = true. You can try explicitly selecting and unselecting rows. I suspect this will take some coding to implement.


AD Administrator Syncfusion Team April 19, 2005 09:24 AM

No, you can select mutiple rows using standard selection technique just by setting the grid''s ListBoxSelectionMode property. The grid supports the 3 standard row selection modes which are set by using the grid.ListBoxSelectionMode property and setting it to SelectionMode.One, SelectionMode.MultiSimple and SelectionMode.MultiExtended. The grid.SelectionChanging is a grid event that you can use to prevent a potential selection form occurring or not. I thought the previous post on this thread was requesting some behavior that is not one of the standard selection behaviors. In that case, you would have to try to code it yourself. If you want multisimple behavior but with keys, then you will have to code it. If you cannot get it working just using the grid.SelectionChanging event, then you can try writing your own selection mouse controller to handle this. We ship a couple of samples of creating your own mousecontroller (the \In Depth\ExcelSelectionMarker, \In Depth\CellCommentTips and \In Depth\FormulaCellSelection) though all may not be in 1.6. If you have our source code, you can copy the current selection controller code into your own class and try to modify it to handle the keys. The code is in this file: GridSelectCellsMouseController.cs

Loader.
Live Chat Icon For mobile
Up arrow icon