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
215
ComboBox for some rows?
posted
Hi, im trying to do something like this... Basically I want to display a ComboBox if the current row meets some condition (Record.DataItem.Inherited), otherwise display a standard textBox.. Is this possible? if so, my current xaml isnt working, any ideas why? Thanks. EDIT: code added to next post.. sorry it looks so nasty..
  • 215
    posted
    <Style TargetType="{x:Type igEditors:XamTextEditor}" x:Key="customComboBoxEditor"> <Setter Property="EditTemplate"> <Setter.Value> <ControlTemplate TargetType="{x:Type igEditors:XamTextEditor}"> <TextBox Margin="{TemplateBinding Padding}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}" /> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.DataItem.Inherited}" Value="True"> <Setter Property="EditTemplate"> <Setter.Value> <ControlTemplate TargetType="{x:Type igEditors:XamTextEditor}"> <ComboBox SelectedValuePath="ID" DisplayMemberPath="itemText" IsEditable="False" ItemsSource="{DynamicResource ericList}" SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ID, Mode=TwoWay}"> </ComboBox> </ControlTemplate> </Setter.Value> </Setter> </DataTrigger> </Style.Triggers> </Style>