Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
How to bind the values inside datatrigger of Xamgrid?
posted

Hi,

I unable to bind the textblock inside datatemplate inside datatrigger of Xamgrid. Kindly suggest solution to bind. I think i m missing incorrect binding.

<efwc:EclpXamGrid Name="uxtest" HorizontalAlignment="Stretch" Grid.Row="2"
Margin="2,2,0,0" AutoGenerateColumns="False"
ItemsSource="{Binding FOO, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">

<efwc:EclpXamGrid.Columns>
<ig:TextColumn Key="ID" HeaderText="ID" ></ig:TextColumn>
<ig:TemplateColumn Key="EntityContextName" HorizontalContentAlignment="Center">
<ig:TemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Context" />
</DataTemplate>
</ig:TemplateColumn.HeaderTemplate>
<ig:TemplateColumn.CellStyle>
<Style TargetType="ig:CellControl">
<Style.Triggers>
<DataTrigger Binding="{Binding Name}" Value="A">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding Name}" ></TextBlock>
<TextBox Text="{Binding Occupation}" />
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding EntityContextName}" Value="B">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding Name}" ></TextBlock>
<TextBox Text="{Binding MobileNO }" />
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ig:TemplateColumn.CellStyle>
</ig:TemplateColumn>
</efwc:EclpXamGrid.Columns>
</efwc:EclpXamGrid>