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
525
SelectedColumn collection
posted

Hi,

I use the SelectionSettings.SelectedCells collection to do some calculations with that content.

I want to do the same thing when I use SelectionSettings.SelectedColumns. My problem is that I don't find a way to get the associated selected cells in a SelectedColumn item.

Does anybody know how I can do that ?

Regards,

Nicolas

Parents
No Data
Reply
  • 6475
    Suggested Answer
    posted

    You'll need to loop through the Rows collection in order to access all cells in a specific column.

    So, to loop through all cells in the selected columns, you'll need something like this:

    foreach (Column col in myGrid.SelectionSettings.SelectedColumns)

    {

    foreach(Row row in myGrid.Rows)

    {

    Cell cell = (Cell)row.Cells[col];

    //Do something with this cell

    //....

    }

    }

    Note that for a large amounts of data this could be a performance breaking operation.

     

    Hope that helps,

Children
No Data