Home Forums WinForms controls Xceed Grid for WinForms record count in a detail grid

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

    hello,

    I’d like to get a count of the records in a detail grid

    I always get 0 when using gcDetail.DataRows.Count (there are rows in the detail grid)

    thanks

    Imported from legacy forums. Posted by Leonard (had 2542 views)

    User (Old forums)
    Member
    Post count: 23064

    You need to get to the detail grid through the master grid. Once a row in teh detail grid is selected, you can run through them by calling it as a member of the master grid’s row’s collection.

    Try the following:

    foreach(Xceed.Grid.DataRow row in masterGrid.SelectedeRows)
    {
    int count = int.Parse(row.ParentGrid.DataRows.Count.ToString());
    MessageBox.Show(count.ToString());
    }

    Imported from legacy forums. Posted by KenG (had 3750 views)

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