Posted 26 January 2022, 2:47 pm EST
Hi,
Please note, there is no direct way in C1FlexGrid to know about the details row loading . However, you can use a specific workaround based on the requirement using PreviewMouseLeftButtonUp event as shown below.
private void Grid_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
Point p = e.GetPosition(grid);
HitTestInfo hittest = grid.HitTest(p);
if (hittest.CellType == CellType.RowHeader && grid.Rows[hittest.Row + 1].IsVisible == true)
{
var panel = hittest.Panel.GetCellRect(hittest.CellRange);
var ele = grid.InputHitTest(new Point() { X = panel.Width + 10, Y = grid.ColumnHeaders.ActualHeight + panel.Bottom + 10 });
if (ele is TextBlock && (ele as TextBlock).Parent is Grid)
{
Grid sp = (ele as TextBlock).Parent as Grid;
MessageBox.Show("Main Row Index = " + hittest.Row + "\n Detail Row Index = " + (hittest.Row + 1) + "\n\n" + (sp.Children[0] as TextBlock).Text + (sp.Children[1] as TextBlock).Text + "\n" + (sp.Children[2] as TextBlock).Text + (sp.Children[3] as TextBlock).Text);
}
}
}
Note: implementation is specific to use case there is no guaranteed to work for all time.
We have also attached the sample for your reference FlexGrid__1_.zip.
Regards,
FlexGrid__1_.zip