Hi,
For some reason the following events are not working when using DataTemplates in a column:
When the user changes a value in one of the columns of a row I want to enable a button.
Of course I can use the SelectionChange event of the comobox but that will also be fired as I set the itemsource of the grid.
Update: My situation is solved:
The HasChanges did the trick for me but the fact stays that it is very strange why the events didn't work.
For some reason the following events are not working when using DataTemplates in a column:
_BeginningEdit
_RowValidated
_RowValidating
...
The events are working for column "Type 2" but for column "Type 3" they don't.
The XAML code is:
<
telerik:GridViewComboBoxColumn
Header
=
"Type 3"
Width
=
"150"
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
telerik:RadComboBox
Name
=
"TypeComboBox"
DisplayMemberPath
=
"TypeDescription"
SelectedValuePath
=
"TypeId"
SelectedValue
=
"{Binding HourType, Mode=TwoWay}"
ItemsSource
=
"{Binding CategoryTypes, Source={StaticResource CategoryTypeList}}"
IsEnabled
=
"{Binding Id, Converter={StaticResource HourTypeFormatter}}"
SelectionChanged
=
"TypeComboBox_SelectionChanged"
/>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewComboBoxColumn
>
<
telerik:GridViewComboBoxColumn
Header
=
"Type 2"
Width
=
"150"
DisplayMemberPath
=
"TypeDescription"
SelectedValueMemberPath
=
"TypeId"
DataMemberBinding
=
"{Binding HourType, Mode=TwoWay}"
ItemsSource
=
"{Binding CategoryTypes, Source={StaticResource CategoryTypeList}}"
>
</
telerik:GridViewComboBoxColumn
>
When the user changes a value in one of the columns of a row I want to enable a button.
Of course I can use the SelectionChange event of the comobox but that will also be fired as I set the itemsource of the grid.
Update: My situation is solved:
<
Button Click="ToolBarClick" Tag="Save" IsEnabled="{Binding ElementName=DS_Categories, Path=HasChanges}">
<Image Width="16" Height="16" Source="/GaSuite;component/Images/save.png" Tag="Save" ToolTipService.ToolTip="Save"/>
</Button>
The HasChanges did the trick for me but the fact stays that it is very strange why the events didn't work.