This is a migrated thread and some comments may be shown as answers.

How to set column size for tree list view

2 Answers 68 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Cynthia
Top achievements
Rank 1
Cynthia asked on 02 Mar 2012, 02:43 AM
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 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Mar 2012, 08:07 AM
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 >>
0
Cynthia
Top achievements
Rank 1
answered on 02 Mar 2012, 07:40 PM
thanks for responding. 
I already tried this solution. It doesn't work. :((
Tags
TreeListView
Asked by
Cynthia
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Cynthia
Top achievements
Rank 1
Share this question
or