This is a migrated thread and some comments may be shown as answers.

UpdateSourceTrigger no effect on GridViewCheckBoxColumn???

3 Answers 453 Views
GridView
This is a migrated thread and some comments may be shown as answers.
swarmttied
Top achievements
Rank 1
swarmttied asked on 31 Jan 2012, 01:04 AM
Even with the markup below, my object source is updated only after losing the focus. It should be during the checking and unchecking. Is there something wrong here?

<telerik:GridViewCheckBoxColumn Header="Accepted" MinWidth="75" MaxWidth="75" 
                          DataMemberBinding="{Binding IsAccepted, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                          AutoSelectOnEdit="True" EditTriggers="CellClick"/>

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 01 Feb 2012, 09:23 AM
Hello,

 Indeed, this is the expected behaviour. Please use a CellTemplate inside the column instead:

<telerik:GridViewColumn>
         <telerik:GridViewColumn.CellTemplate>
               <DataTemplate>
                     <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                </DataTemplate>
         </telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>

Is this what do you need?

Regards,
Didie
the Telerik team

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

0
Martin
Top achievements
Rank 1
answered on 03 Jan 2019, 04:15 PM
This behavior is a bit weird since it means that UpdateSourceTrigger is completely useless. Is there any reason why the UpdateSourceTrigger is not used at all?
0
Dilyan Traykov
Telerik team
answered on 07 Jan 2019, 12:36 PM
Hello Martin,

The reason why the UpdateSourceTrigger property is not respected in this case is due to the control's validation mechanism. By design, the binding is only updated when changes to the current cell are committed - once the cell loses focus or the Enter key is pressed.

As explained by my colleague, the way to bypass this is to use a custom cell template with a two-way binding to the underlying property.

I hope you find this clarification helpful. Should any other questions or concerns arise, do not hesitate to ask.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
swarmttied
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Martin
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or