Gridview ColumnHeader

1 posts, 0 answers
  1. gisela
    gisela avatar
    15 posts
    Member since:
    Feb 2006

    Posted 29 Jan 2013 Link to this post

    i'm using the following xaml:

    <telerik:RadGridView x:Name="Grid" AutoGenerateColumns="False" ItemsSource="{Binding GridDataPoints}"

     SelectedItem="{Binding SelectedDay, Mode=TwoWay}"

     FrozenColumnCount="3" >


     <telerik:GridViewDataColumn Width="90" DataMemberBinding="{Binding Ist.TimeRange.Start, StringFormat=\{0:dd.MM.yyyy\}}" CellStyle="{StaticResource TextCell}">


     <Style TargetType="telerik:GridViewHeaderCell" BasedOn="{StaticResource HeaderCellLeft}">

     <Setter Property="ContentTemplate">



     <TextBlock Text="{Binding DataContext.ColumnHeaderDate, ElementName=LayoutRoot}" />







    All works fine, but I want bind another control to the columns header, so the user can change the visibility of columns:




    <Border Margin="8">

     <ListBox ItemsSource="{Binding Columns}" Background="Transparent" Style="{StaticResource ListBoxStyle}" Foreground="White" Margin="8" >

     <ListBox.ItemTemplate >


     <CheckBox Content="{Binding Header}"

     IsChecked="{Binding IsVisible, Mode=TwoWay}" />





    The listbox displays not the bound value of 'DataContext.ColumnHeaderDate', it displays 'Ist.TimeRange.Start'.
    How can i bind the Checkbox to display the value of 'DataContext.ColumnHeaderDate' ?




     Thanks in advance

Back to Top