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

Binding element inside datatemplate

0 Answers 6 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Ishita
Top achievements
Rank 1
Ishita asked on 22 Sep 2014, 11:05 AM
Hi, 
      As per the requirement , i have a Gridviewcolumn in TreeListView for Icon + Text in a single cell. 
I am using data template. 
<DataTemplate x:Key="datatemplate">
         <Grid>
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="Auto"/>
                 <ColumnDefinition Width="*"/>
             </Grid.ColumnDefinitions>
             <Image Grid.Column="0" Source="{Binding TreeList_IconImage, Converter={StaticResource ConvertStringToImge}}"/>
             <TextBlock Grid.Column="1" Name="txtText"  />
         </Grid>
</DataTemplate>
and 
 in Xaml.cs , C#
GridViewColumn templateColumn = new GridViewColumn();
                           templateColumn.CellTemplate = (DataTemplate)Resources["datatemplate"];
                           templateColumn.Header = SLColumnName[ColumnName.Key.ToString()].ToString();
                           // I want to set bindning to TextBlock inside Datatemplate.
  radTreeListView.Columns.Add(templateColumn);
 I want to set bindning to TextBlock which is inside Datatemplate. 
 I dont want to set binding in xaml page as the name of column will come from database. 

No answers yet. Maybe you can help?

Tags
TreeListView
Asked by
Ishita
Top achievements
Rank 1
Share this question
or