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
510
How to capture the selected rows of a selected band in an UltraGrid.
posted

On a toolbar manager button event I would like to process an action on each selected row of a specific band from an UltraGrid.

I have read many postings on this form but none of them explain clearly how to capture the selected rows of a specific band in the grid.

The grid band is [1] with the name "ttReceiptLines". Would prefer using names over index numbers (more clear for reading source which data object you work on).

What kind of object do I need to capture the selected rows? Can this be a RowsCollection?

How can I process each item of the collection to read info from them?

Need to identify the line number, the quantity and other line info to process and forward them to an other Receipt List.

Kind regards,

Peter Wokke

 

Parents
No Data
Reply
  • 23930
    Offline posted

    Hi Peter,

    Thank you for posting in our forums.

    You can get the selected rows from a specific band using the following line:

    var selectedRows = ultraGrid1.Selected.Rows.OfType<UltraGridRow>().Where(r => r.Band.Key == "ttReceiptLines").ToList();

    This will return you a collection of type List<UltraGridRow> and you can use the cells collection of each row to get the information you need when you are generating your Receipt List.

    Please let me know if you have any additional questions.

Children