How to set the format of the master line

10 posts, 1 answers
  1. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 28 Apr 2011 Link to this post

    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
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 29 Apr 2011 Link to this post

    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
  3. DevCraft banner
  4. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 29 Apr 2011 Link to this post

    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.
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 02 May 2011 Link to this post

    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
  6. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 02 May 2011 Link to this post

    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?
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 02 May 2011 Link to this post

    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
  8. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 02 May 2011 Link to this post

    Now it shows the Department name beside the Expander, but not in the detail record. I guess I can live with that.

    Thanks
  9. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 02 May 2011 Link to this post

    How do I get rid of the sort indicators and the Filter symbol from the column headers?

    Cheers,

    Helen
  10. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 02 May 2011 Link to this post

    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
  11. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 02 May 2011 Link to this post

    Great, that did it!

    Thanks
Back to Top
DevCraft banner