use a generic horizontal scroll for c1datagrid and RowDetailsTemplate

Posted by: ducpv.2901 on 7 August 2018, 7:39 pm EST

  • Posted 7 August 2018, 7:39 pm EST

    Hi everyone,

    How can I use a generic horizontal scroll for c1datagrid and RowDetailsTemplate

  • Replied 8 August 2018, 10:09 pm EST

    Before we proceed further with solution, I would like to confirm whether you want to replace the horizontal scrollbar shown for grid and nested detailed grid OR do you want to have a common scrollbar for scrolling grid and its nested grid ?
    If your requirement is the first one, then you may use the Style (you may get it from C:\Program Files (x86)\ComponentOne\WPF Edition\C1WPFDataGrid.4\XAML location ) and then try to find the element with name: HorizontalScrollBar and replace it/customize it as per your requirements. And finally use this style in XAML for your C1DataGrid
    However, if your requirement is latter one, then I would like to ask you how do want to scroll both outer and inner datagrid with a single horizontal scrollbar. That is when moving the scrollbar how should the scrolling be performed? Should it first scroll the outer grid or inner grid completely? Or should it perform scrolling simultaneously? Or any other ideas?

  • Replied 9 August 2018, 12:56 pm EST


    First of all I would like to thank you for your answer.
    And I want to when moving the scrollbar should it perform scrolling simultaneously. You can fix issue?

  • Replied 12 August 2018, 4:20 pm EST


    We are working on your requirement and will get back to you soon.

  • Replied 13 August 2018, 10:12 pm EST

    Upon researching over this requirement, we found that there are many following issues related to implementing it:
    1. If you want to perform scrolling simultaneously, then you would be willing to hide one of the horizontal scrollbars , probably the internal one. If this is done, then the end-user would not be able to view the right columns without scrolling the parent grid.
    2. If the child grid has columns more or less than the parent grid, then scrolling wouldn't work properly. Since the unit of scroll for parent would be different than that of child and this will lead to further issues.
    3. If there are multiple child grids expanded, then should the scrolling be performed for all grids?
    4. What would happen if there are nested level is increased, That is if further child grids are added to the RowDetailTemplate of child grid?
    So, we would like to ask to you as to why you want to perform scrolling synchronously ? Also, could you share any video where anything similar to your requirement is implemented?
    If still you want to implement it, the solution would be specific to your application. Hence, we would like you to share your application/stripped application which we could modify to meet your requirement.

  • Replied 14 August 2018, 7:33 pm EST


    Thanks for your responding! About your requirement, I just write a few line to modify data template in row details as I want, you will see in the image I attached in this post. And I didn't use any events to change how it work, like LoadedRowDetailsPresenter... so I don't think I can give you more than the thing you have. But I can share to you a video that will explain to you what I'm trying to do. The following issues when implement solution, properly you right, but I willing to accept to resolve my problem. Do you have any ideal to make the UI of C1DataGrid doing as or similar as in my video?

    Thank you!
  • Replied 14 August 2018, 7:34 pm EST

  • Replied 14 August 2018, 7:36 pm EST
  • Replied 16 August 2018, 6:05 pm EST

    Thank you for sharing the video file. I understand your requirement.
    To meet your needs, I am discussing them with the development team [ID:339449] and will update you once we have a solution or some information related to it.
    Thank you.
  • Replied 20 August 2018, 3:55 pm EST


    After discussing the requirement internally, we suggest you to either make the master grid column wide-enough to show all child grid columns or show a ToolTip with long content.

  • Replied 21 August 2018, 6:31 pm EST

    Sorry,I can't do that,this is request from my customer.Will you fix that for me!
    Thanks for reading!
  • Replied 22 August 2018, 5:15 pm EST


    First, I would like you to know that this is not an issue/bug, horizontal scrollbar appearing for both master and child grids and scrolling independently is by-design.
    However, I am once again discussing your requirement with the team to see if there is anything that can be done for you.
    I will update you with the information/solution soon.

  • Marked as Answer

    Replied 27 August 2018, 11:37 pm EST


    Please refer to attached sample implementing your requirement. Also, a video showing the behavior has been attached.
    Hopefully it would meet your concerns.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels