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

How to set the format of the master line

9 Answers 67 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Helen
Top achievements
Rank 2
Helen asked on 29 Apr 2011, 12:30 AM
I am binding a TreeListView to a master-detail datasource (departments with staff). How do I get the line displaying the Master record to show the department name? I've attached a screen shot of what I have so far.

Thanks

Helen

9 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 29 Apr 2011, 08:22 AM
Hello Helen,

 

May you please elaborate a little bit more about your exact settings?
Regarding the attached pictures I suggest that you need to access the black border around RadTreeListView. Have you changed the BorderBrush of RadTreeListView to Black or maybe I am missing something? 
You may share with us the code-snippet you are currently using, thus we would be able to provide you with an appropriate solution. Furthermore I believe that the best option is to send us a small repro in a new support ticket where we can see what happens.


Regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Helen
Top achievements
Rank 2
answered on 29 Apr 2011, 06:35 PM
Here's my Xamle:

<telerik:RadTreeListView x:Name="MyTreeListView" Grid.Row="2" Grid.ColumnSpan="2" Margin="8" 
                    AutoGenerateColumns="False"
                    BorderBrush="Black"
                    IsReadOnly="True" 
                    SelectionMode="Single"
                    CanUserFreezeColumns="False"
                    CanUserReorderColumns="False"
                    CanUserResizeColumns="False"
                    CanUserSortColumns="False"
                    ShowGroupPanel="True"
                    HierarchyColumnIndex="0"  
                    ItemsSource="{Binding DataView, ElementName=SBDomainDataSource}"                           
                    SelectionChanged="MyTreeView_SelectionChanged" >
    <telerik:RadTreeListView.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Path=DepartmentName}" Width="150" />
        </DataTemplate>
    </telerik:RadTreeListView.ItemTemplate>
                         
    <telerik:RadTreeListView.SortDescriptors>
        <telerik:SortDescriptor Member="DepartmentName" SortDirection="Ascending"></telerik:SortDescriptor>
    </telerik:RadTreeListView.SortDescriptors>
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding People}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:RadTreeListView.Columns>
        <telerik:GridViewColumn Width="50" />
        <telerik:GridViewDataColumn x:Name="departmentColumn"  Header="Department" UniqueName="ColDept"
                                    DataMemberBinding="{Binding Path=Department.DepartmentName, Mode=TwoWay}" 
                                    IsReadOnly="True"
                                    ShowFieldFilters="False"
                                      
                                        />
        <telerik:GridViewDataColumn x:Name="surnameColumn" Header="Surname" UniqueName="ColLastName"
                                    DataMemberBinding="{Binding Path=LastName, Mode=TwoWay}"
                                    TextWrapping="Wrap" IsReadOnly="True"
                                    ShowFieldFilters="False"
                                    SortingState="Ascending"
                                    >
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn x:Name="firstnameColumn" Header="First Name" UniqueName="ColFirstName"
                                    DataMemberBinding="{Binding Path=FirstName, Mode=TwoWay}" 
                                    TextWrapping="Wrap" IsReadOnly="True"
                                    />
        <telerik:GridViewDataColumn x:Name="extColumn" Header="Extension" 
                                    DataMemberBinding="{Binding Path=Extension}" 
                                    TextWrapping="Wrap" IsReadOnly="True"
                                    />
        <telerik:GridViewImageColumn x:Name="thumb" Header="Image" 
                                    DataMemberBinding="{Binding Path=imageData, Mode=TwoWay }" ImageWidth="100" 
                                    IsReadOnly="True" />
    </telerik:RadTreeListView.Columns>                            
      
</telerik:RadTreeListView>

The data source is a master-detail of Department (Department_uid, DepartmentName, People) where People is an EntityCollection<Person>. All I want is ti have the DepartmentName field displayed beside the Expander.
0
Vanya Pavlova
Telerik team
answered on 02 May 2011, 08:23 AM
Hello Helen,

 

Within the departmentColumn just directly specify the DepartmentName and it would be correctly displayed:

<telerik:GridViewDataColumn x:Name="departmentColumn"  Header="Department" UniqueName="ColDept"
                                   DataMemberBinding="{Binding Path=DepartmentName, Mode=TwoWay}"
                                   IsReadOnly="True"
                                   ShowFieldFilters="False"/>


Best wishes,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Helen
Top achievements
Rank 2
answered on 02 May 2011, 04:33 PM
I'm sorry, this doesn't make any sense to me.

Are you saying I have to define a column group in the ItemTemplate's DataTemplate?
0
Vanya Pavlova
Telerik team
answered on 02 May 2011, 05:32 PM
Hello Helen,

 

Generally you do not have to use the RadTreeListView's ItemTemplate property in such manner. I tested your code by my side and I was able to get the same effect from the attached picture. When you are specifying such binding in the department column the values for the respective DepartmentName property were not displayed. By that reason I suggested to change the binding as it was shown in my previous reply. Change the binding remove the RadTreeListView's ItemTemplate and let me know what happens.


In case of any misunderstandings let me know.


Greetings,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Helen
Top achievements
Rank 2
answered on 02 May 2011, 06:54 PM
Now it shows the Department name beside the Expander, but not in the detail record. I guess I can live with that.

Thanks
0
Helen
Top achievements
Rank 2
answered on 02 May 2011, 08:33 PM
How do I get rid of the sort indicators and the Filter symbol from the column headers?

Cheers,

Helen
0
Accepted
Vanya Pavlova
Telerik team
answered on 02 May 2011, 08:47 PM
Hello Helen,

 

In this case you have to edit the template of GridViewHeaderCell. There you may find the parts named PART_SortIndicator (which represents the sort indicator of a column and is of type Path) and the PART_DistinctFilterControl (which represents the filtering control of a column and is of type FilteringDropDown). Just remove them from the template and the corresponding states where they are used. 


Kind regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Helen
Top achievements
Rank 2
answered on 02 May 2011, 10:55 PM
Great, that did it!

Thanks
Tags
TreeListView
Asked by
Helen
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
Helen
Top achievements
Rank 2
Share this question
or