RowEvents not working when using datatemplate

2 posts, 0 answers
  1. Gilbert van Veen
    Gilbert van Veen avatar
    74 posts
    Member since:
    Oct 2009

    Posted 18 Nov 2011 Link to this post


    For some reason the following events are not working when using DataTemplates in a column:








    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: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"/>
                              <telerik:GridViewComboBoxColumn Header="Type 2" Width="150"
                                  DisplayMemberPath="TypeDescription" SelectedValueMemberPath="TypeId"  DataMemberBinding="{Binding HourType, Mode=TwoWay}" ItemsSource="{Binding CategoryTypes, Source={StaticResource CategoryTypeList}}" >

    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"/>







    The HasChanges did the trick for me but the fact stays that it is very strange why the events didn't work.
  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 22 Nov 2011 Link to this post

    Hi Gilbert Van Veen,

    Indeed those events are only raised when a cell from the row is in "edit mode". To edit the cell, you should put the RadComboBox in a CellEditTemplate. To show the selected value, you could use a TextBlock in the CellTemplate.

    Please let me know how this works for you.

    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top