Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
Can a grid with SelectedCells and SelectedRows be achieved?
posted

I am looking for ideas on how to achieve the following type of selection behavior on an Ultragrid.

My grids typically have SelectTypeRow = Extended, SelectTypeCell = None and SelectTypeCol = None and the CellClickAction = RowSelect.  This works well, however it's not very convenient when users want to copy values from just a few cells (not entire rows). 

I want to allow users to select cells, have those cells exposed via the SelectedCells property AND have all rows that contain a selected cell also be considered selected and be exposed via the SelectedRows property.  During a Copy operation I would copy the values of the SelectedCells to the clipboard.  If the user wanted to copy the entire row to the clipboard, they would have to select all the cells in the row. 

I know I can set the SelectTypeCell to Extended and change the CellClickAction to CellSelect, but this results in SelectedCells only (no rows are selected).  I want to have a grid that can have SelectedCells and SelectedRows at the same time. Any ideas on how to achieve this type of behavior?

 

 

Parents
No Data
Reply
  • 23930
    Offline posted

    Hi John,

    Thank you for contacting Infragistics Developer Support.

    Generally the grid can’t have selected cells and selected rows at the same time. What you could do is to use SelectTypeCell to Extended and change the CellClickAction to CellSelect and then keep a collection of the rows that should be selected. You can use the BeforeSelectChange or AfterSelectChange events for this goal. This way you will have access to the selected cells and the “selected” rows at the same time.

    I have attached a sample demonstrating this suggestion.

    Please let me know if you have any additional questions.

    WG_SelectedCellsAndSelectedRows.zip
Children