RowDetails Content Truncated

Posted by: rdbrownii on 17 September 2017, 2:55 am EST

    • Post Options:
    • Link

    Posted 17 September 2017, 2:55 am EST

    I’m using the RowDetailsTemplate feature of the C1DataGrid to display child data of the parent row. The child details are presented in a subordinate C1DataGrid. The problem is that the RowDetails grids are truncated to the combined width of the parent grid’s columns and neither the parent nor child grids present a horizontal scrollbar to allow the viewing of the truncated portion of the details section when the parent grid’s columns don’t fill the available viewport. How can I get the scrollbars to without having to have the last column extraordinarily wide?

    Thanks… Rick

  • Posted 17 September 2017, 4:41 pm EST

    Hi,

    I tried the same at my end and found horizontal scrollbar is shown on both grid (Parent and Subordinate).

    See the attached image and sample for complete implementation.

    If this does not solve your issue then share a sample application with us for replicating the same.

    So that we can assist you further accordingly.

    WpfApplication2.zip

    Thanks,

    Singh Sonu

  • Posted 18 September 2017, 7:59 am EST

    Hi Singh,

    Thanks for the response and the sample app. If you add the parameter ColumnWidth=“Auto” to the main grid you will see what I’m talking about. While the main grid’s column’s width are automatically calculated to be wide enough for the content and headers, leaving the rest of the “viewport” blank. This is the expected result. However, the child table does not use the available viewport of the main table, just the width of the parent row. I would expect the child table to use as much space in the viewport that it needs and add scroll bars if additional space is needed, just like the parent table would do if it’s content exceeded the available space in the viewport. I’ve attached a modified version of your sample project and a screen shot that illustrates the problem.

    Thanks… RickWpfApplication2.zip

  • Posted 18 September 2017, 3:31 pm EST

    Hi,

    I escalated this to concern team. Will let you know as soon as there is any information from them.

    Thanks,

    Singh

  • Posted 19 September 2017, 6:25 pm EST

    Hi,

    You can set a MinColumnWidth to C1DataGrid, which will make the entire row’s width exceed the RowDetails’ desired width.

    Thanks,

    Singh Sonu

  • Posted 20 September 2017, 2:33 am EST

    Hi Singh,

    I see how that might get around the truncation problem by artificially making each column in the parent row much wider than needed, but it doesn’t meet my business requirements nor does it address my core concern. A child grid in the row details area should not be truncated by the width of the parent row. The row details area should be able to use the full width of the parent table, and add a horizontal scrollbar if more space is needed.

    Thanks… Rick

  • Posted 22 September 2017, 12:46 am EST

    Hi Rick,

    This case is in discussion with the developers. We will update you once we receive some information from them.

    Regards,

    Ruchir Agarwal

  • Posted 4 November 2017, 5:26 am EST

    Hi,

    Can you give me an updated status on this issue?

    Thanks… Rick

  • Posted 2 December 2017, 11:24 pm EST

    Hi,

    I’t s been over two months since I’ve heard anything on this case. Can you provide an update?

    Thanks… Rick

  • Posted 4 December 2017, 3:42 pm EST

    Hi Rick,

    The Developers did research over this case and have responded as follows:

    if C1DataGrid has an available space with width: 1000px, and when you set ColumnWidth=‘Auto’, that means, the entire valid row may be just occupied 300px. Then, we use this size(300px) to measure RowDetails, but if RowDetails’ desired width exceeds 300px, it will be truncated.

    Considering the large effect which may caused by changing this, it is suggested to use the earlier mentioned workaround.


    Still, we are again asking them whether is there anything else that can be done apart from the workaround {Tracking ID: 286738}.

    I would update you as soon as we get some information from them.

    Thanks,

    Ruchir Agarwal

  • Posted 9 April 2018, 10:31 pm EST

    Hi Rick,

    For adding a scrollbar to child grid when data in child grid exceeds, you may change ColumnWidth to AutoStar in parent grid and set HorizontalAlignment to Stretch in child grid, as follows:

    <c1:C1DataGrid x:Name="datagrid1" CanUserAddRows="False" 
    ColumnWidth="Auto*" IsReadOnly="True"
    RowDetailsVisibilityMode="Visible">
       <c1:C1DataGrid.RowDetailsTemplate>
              <DataTemplate>
                  <c1:C1DataGrid x:Name="gridProducts" HorizontalAlignment="Stretch"
                        Style="{StaticResource SecondLevelGrid}"
                        Margin="10"
                         CanUserAddRows="False"
                         IsReadOnly="True"/>
             </DataTemplate>
       </c1:C1DataGrid.RowDetailsTemplate>
    </c1:C1DataGrid> 
    ```Following this approach, you should get following output.
    [img]https://gccontent.blob.core.windows.net/forum-uploads/file-e9d5069a-7f3e-4d42-8e58-213241d7fe1e.gif[/img]
    
    Regards,
    Ruchir Agarwal
Need extra support?

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

Learn More

Forum Channels