Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
925
Scrolling XamDataGrid problem
posted

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:

 

  1. Parent XamDataGrid not scrolling as expected
    a) Start sample application
    b) Expand both rows
    c) While mouse is over the expanded second row (red border) the scrolling works which is what I want.
    d) While the mouse is over the expanded first row the scrolling does not work as I expect.
     What can I do to scroll the parent XamDataGrid always independent on where the mouse cursor is as long as the cursor is within the bounds of the parent XamDataGrid?
     There will never be a situation for me where I would like to scroll a child grid.
  2. Cannot change the value in Combobox field
    a) Start sample application
    b) Expand first row
    c) Open drop down for Target Version
    d) Click Target 1 -> The cell displays an empty string. I expect that Target 1 is displayed.
     What can I do to achieve this?
  3. Parent XamDataGrid not sizing properly
    a) Start sample application
    b) Expand second row -> Vertical scrollbar visible as expected -> ok
    c) Pull the scrollbar to the bottom -> The bottom of the red border is not displayed. I expect the bottom being displayed when scrolling to the end using mouse wheel and the scrollbar.
     What can I do to achieve this?

3603.SelectTemplateForExpandedChildRecord.zip

  • 2680
    Offline posted

    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;
    }

    Below you can find attached a simplified sample, replicating the setup from your own one, where this is demonstrated.

    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 Pachilova
    Associate Software Developer

    7875.XDGExpandableCellsForum.zip

  • 2680
    Offline posted

    Hello Tomas,

    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