2 Grids with same column width

3 posts, 0 answers
  1. Mark
    Mark avatar
    14 posts
    Member since:
    Sep 2012

    Posted 22 Jan 2013 Link to this post

    Hi,

    i have a view with two RadGridView, in both the Columns are autogenerated.
    In the second one the property ShowColumnHeaders is set to false, so you don't see that there are two grids.
    In the view you see a GridView, a black line and then the next GridView.

                <telerik:RadGridView x:Name="TodoGrid"
                                     Grid.Row="0"
                                     Width="auto"
                                     Height="auto"
                                     AutoGenerateColumns="True"
                                     CanUserDeleteRows="False"
                                     CanUserFreezeColumns="False"
                                     CanUserInsertRows="False"
                                     CanUserResizeColumns="True"
                                     ColumnWidth="*"
                                     IsReadOnly="True"
                                     SelectionUnit="Cell"
                                     ItemsSource="{Binding ToDoRows}"
                                     RowIndicatorVisibility="Collapsed"
                                     ScrollViewer.VerticalScrollBarVisibility="Visible"
                                     ShowGroupPanel="False" />
     
    .
    .
    .
    .
     
                <telerik:RadGridView x:Name="DoneGrid"
                                     Grid.Row="2"
                                     Width="auto"
                                     Height="auto"
                                     AutoGenerateColumns="True"
                                     CanUserDeleteRows="False"
                                     CanUserFreezeColumns="False"
                                     CanUserInsertRows="False"
                                     CanUserResizeColumns="False"
                                     ColumnWidth="*"
                                     SelectionUnit="Cell"
                                     IsReadOnly="True"
                                     ItemsSource="{Binding DoneRows}"
                                     RowIndicatorVisibility="Collapsed"
                                     ScrollViewer.VerticalScrollBarVisibility="Visible"
                                     ShowColumnHeaders="False"
                                     ShowGroupPanel="False" />

    The user can resize the columns in the top grid and i want now that the columns on the bottom grid resize in the same way like the top ones. I try to handle this about the ResizingEvent but don't find a working solution.

    Can somebody please support me by this issue.
  2. Yoan
    Admin
    Yoan avatar
    1182 posts

    Posted 23 Jan 2013 Link to this post

    Hello Mark,

    In order to achieve your goal, I would suggest you to check the attached solution in this forum thread. You could use a similar approach in your scenario.


    I hope this helps.

    Regards,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Mark
    Mark avatar
    14 posts
    Member since:
    Sep 2012

    Posted 24 Jan 2013 Link to this post

    Thank you for your reply.

    There are two problems, i want it for all my columns and my columns are auto generated.
    So i cant use the way about a property in my ViewModel because i do not know the number of columns.
Back to Top