Hi,
I have a XamGrid which is bind to a list of objects.
The grid contain ComboboxColumn.
I would like to make the combobox disabled (or even hidden if possible) for certain rows, based on a boolean value which is part of the object.
How could I do that in XamGrid?
<ig:ComboBoxColumn Key="AggregationMethod" HeaderText="Aggregation Method" AllowEditingValidation="True" EditorDisplayBehavior="Always" > <ig:ComboBoxColumn.CellStyle> <Style TargetType="ig:CellControl"> <Setter Property="Margin" Value="1"></Setter> <Setter Property="Padding" Value="0"></Setter> </Style> </ig:ComboBoxColumn.CellStyle> <ig:ComboBoxColumn.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Converter={StaticResource aggrConverter}}" /> </DataTemplate> </ig:ComboBoxColumn.ItemTemplate> </ig:ComboBoxColumn>
The data class contain:
Enum AggregationMethod
bool AllowAggregation
the combobox should be disabled when the AllowAggregation = false
<ig:TemplateColumn Key="UnitCategory" HeaderText="Units"> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <igWPF:XamComboEditor Width="100" ItemsSource="{Binding Source={StaticResource vm}, Path=UnitCategories}" SelectedItem="{Binding UnitCategory}" IsEnabled="{Binding boolProp}"/> </DataTemplate> </ig:TemplateColumn.ItemTemplate> <ig:TemplateColumn.EditorTemplate> <DataTemplate> <igWPF:XamComboEditor Width="100" ItemsSource="{Binding Source={StaticResource vm}, Path=UnitCategories}" SelectedItem="{Binding UnitCategory}" IsEnabled="{Binding boolProp}" /> </DataTemplate> </ig:TemplateColumn.EditorTemplate> </ig:TemplateColumn>