Home Forums WinForms controls Xceed Grid for WinForms Iterate rows in GroupManagerRow

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15652 |

    How do I iterate over the rows inside a GroupManagerRow?

    Imported from legacy forums. Posted by Amit (had 2272 views)

    Xceed Support
    Member
    Post count: 5658

    There is no “rows” inside a GroupManagerRow, it is a row itself. You can iterate through the DataRows inside the GridControl.

    Going through the row of a gridControl:
    <code>
    foreach( Xceed.Grid.DataRow row in gridControl1.DataRows )
    {
    foreach( Cell cell in row.Cells )
    {
    cell.Value = “…”;
    }
    }
    </code>

    Imported from legacy forums. Posted by CharlesB (had 291 views)

    User (Old forums)
    Member
    Post count: 23064

    I figured out what I was looking to do. Heres’ the code should anyone fall on this thread:

    <pre>
    if (row is Xceed.Grid.GroupManagerRow)
    {
    GroupManagerRow manager = (GroupManagerRow)row;
    foreach (Row rowe in manager.ParentGroup.GetSortedDataRows(true))
    {
    if (rowe is CellRow)
    {
    bool val = (bool)((CellRow)rowe).Cells[0].Value;
    ((CellRow)rowe).Cells[0].Value = !val;
    }
    }

    }
    </pre>

    Imported from legacy forums. Posted by Amit (had 3677 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.