I am struggeling using XamDataGrid as a DataTemplate for ExpandedCellPresenter inside a parent XamDataGrid. The scrolling does not work while rows are expanded and I cannot edit the ComboBox field without pressing a control key. I have attached a sample application. Here are the reproduction steps in detail and my expectations:
3603.SelectTemplateForExpandedChildRecord.zip
Hello Tomas,
Thank you for your patience, while I was investigating this matter.
To address your first question about XamDataGrid not scrolling when the mouse is over the nested XamDataGrid in the first expanded cell presenter, I found this forum thread, where a similar question has been discussed and a workaround approach is suggested. You could implement it for the nested grid scenario by raising the MouseWheelEvent as shown there, but for the parent grid’s ScrollViewer:
private void XdgSender_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) { var e2 = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta); e2.RoutedEvent = UIElement.MouseWheelEvent; this.xdg.ScrollInfo.ScrollOwner.RaiseEvent(e2); e.Handled = true; }
Regarding the second point, after reviewing it with the development team, this has been identified as an issue with the XamDataGrid’s ExpandedCellPresenter. In the attached sample, you could actually observe that this is the case not only for a combo editor within a grid, but for a regular combo editor and even a text box. In response to this issue being logged, I have opened a new private support case for you that I will be linking to this issue so you can be notified when a fix or other resolution becomes available. This private case has an ID of C-00220046 and you can access it here: account.infragistics.com/support-cases.
Lastly, the described behavior when scrolling the grid and the ExpandedCellPresenter content is taller than the viewable area is expectedand correct as the grid does row level scrolling, rather than pixel level scrolling. In point 1, you mention that there will not be a situation, where you would like to scroll a child grid, so this makes me assume that those grids will have a limited amount of records and thus there will be no scenario, where the expanded cell content is as tall as in the sample.
So, a last idea I could suggest is to consider displaying hierarchical data in the XamDataGrid, rather than nesting grids. This feature will essentially achieve the same result, while being easier to maintain and fully functional.
Sincerely,Bozhidara PachilovaAssociate Software Developer
7875.XDGExpandableCellsForum.zip
Thank you for the provided steps and sample!
This is an initial update to let you know that we have received your support request regarding templating Expandable cells in the XamDataGrid and I am currently looking into this matter for you. I will keep you posted on my progress and I will get back to you soon with more information or questions for you.
Please feel free to continue sending updates to this case at any time.
Regards,
Bozhidara Pachilova
Infragistics