Home Forums WinForms controls Xceed Grid for WinForms IsSelectedChanged event

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

    I am attaching IsSelectedChanged event handlers to GridControl and DetailGrid rows at runtime as shown below, but the DetailGrid row event never gets fired. Why?

    I am using version 2.1 and have not used the designer (ie. the grid is created in code)

    Thanks

    kh

    foreach(Xceed.Grid.DataRow row in grid.DataRows)
    {
    // Always fires
    row.IsSelectedChanged+=new EventHandler(row_IsSelectedChanged);

    foreach(Xceed.Grid.DetailGrid detailGrid in row.DetailGrids)
    {
    foreach(Xceed.Grid.DataRow detailRow in detailGrid.DataRows)
    {
    // Never fires
    detailRow.IsSelectedChanged+=new EventHandler(detailRow_IsSelectedChanged);
    }
    }
    }

    Imported from legacy forums. Posted by kh (had 1847 views)

    User (Old forums)
    Member
    Post count: 23064

    as usual, posting made me think a little harder. the event was not firing because i had added a new row and this row did not have the event attached, so the event never fired. if i attach the event during the DetailGrid.AddingDataRow event the behaviour is as expected.

    which brings me to my new question: why can’t i attach the event to the DetailGrid.DataRowTemplate so that it works for new and existing rows? i couldn’t get this to work either.

    kh

    Imported from legacy forums. Posted by kh (had 3038 views)

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