How to set column size for tree list view

3 posts, 0 answers
  1. Cynthia
    Cynthia avatar
    2 posts
    Member since:
    Mar 2012

    Posted 01 Mar 2012 Link to this post

    hi,
    I have a question here. Bascially I have a tree list view, they reside in the same grid. This tree list view has three columns.
    In my current code, I set each of them fixed width.
    Now I want the first column occupies the largest width of the grid, and the other two have fixed size.

    So I tried to set the first column size as "Auto", it's not working.
    Then I tried to set the first colmn size as "3*", the other two are "*". Still not working.

    Anyone knows the answer? Really appreciate it.

                        <Grid Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <!-- Telerik List -->
                            <telerik:RadTreeListView Grid.Column="0">
                                <telerik:RadTreeListView.ChildTableDefinitions>
                                    <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
                                </telerik:RadTreeListView.ChildTableDefinitions>
                                <telerik:RadTreeListView.Columns>
                                    <telerik:GridViewDataColumn     Width="350">
                                        <telerik:GridViewDataColumn.CellTemplate>
                                            <DataTemplate>
                ...
                                            </DataTemplate>
                                        </telerik:GridViewDataColumn.CellTemplate>
                                    </telerik:GridViewDataColumn>

                                    <telerik:GridViewDataColumn      Width="160">
                                        <telerik:GridViewDataColumn.CellTemplate>
                                            <DataTemplate>
                      ...
                                            </DataTemplate>
                                        </telerik:GridViewDataColumn.CellTemplate>
                                    </telerik:GridViewDataColumn>

                                    <telerik:GridViewDataColumn      Width="160">
                                        <telerik:GridViewDataColumn.CellTemplate>
                                            <DataTemplate>
                 ...
                                            </DataTemplate>
                                        </telerik:GridViewDataColumn.CellTemplate>
                                    </telerik:GridViewDataColumn>
                                </telerik:RadTreeListView.Columns>
                            </telerik:RadTreeListView>
                        </Grid>

    Thanks
    Cynthia

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 02 Mar 2012 Link to this post

    Hi,

     You can set star width (*) for the first column and fixed size in pixels for your other columns. 

    Regards,
    Vlad
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Cynthia
    Cynthia avatar
    2 posts
    Member since:
    Mar 2012

    Posted 02 Mar 2012 Link to this post

    thanks for responding. 
    I already tried this solution. It doesn't work. :((
Back to Top