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

[Solved] Update Checkbox Data on value change

3 Answers 176 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ryan
Top achievements
Rank 2
Ryan asked on 19 Oct 2010, 04:05 PM
Can a GridViewCheckBoxColumn trigger an event whe the value changes OR does a unbound checkbox need to be used?   I have a GridViewCheckbox column but am struggleing on how it can update the view model without CelleditEnd being thrown.

<telerik:RadGridView ScrollViewer.VerticalScrollBarVisibility="Auto"RowDetailsVisibilityMode="VisibleWhenSelected" RowIndicatorVisibility="Collapsed"IsSynchronizedWithCurrentItem="True" AutoGenerateColumns="False" ItemsSource="{BindingPath=WorkAccessSource.View, Mode=TwoWay}" SelectionUnit="FullRow" SelectedItem="{BindingCurrentWorkAccessObject, Mode=TwoWay, UpdateSourceTrigger=Default}"SelectionMode="Single"
....
<telerik:RadGridView.Columns>
....
<telerik:GridViewCheckBoxColumn Header="Caps" DataMemberBinding="{Binding CallForCaps,Mode=TwoWay, Converter={StaticResource CharToBooleanConverter}}" IsSortable="True"IsGroupable="True" IsFilterable="False" IsReadOnly="False" HeaderTextAlignment="Center" /> 
...
</telerik:RadGridView.Columns>

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Oct 2010, 07:11 AM
Hello,

 I see that you already have IValueConverter for DataMemberBinding - why not use ConvertBack method to do this?

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ryan
Top achievements
Rank 2
answered on 20 Oct 2010, 04:10 PM
I don't think I made the the scenario clear enough.  The CellEditEnd doesn't fire until focus is lost,etc., therefore the convert doesn't happen at this time.  
The client wants to check the checkbox and the data be committed to the db.  Not wait for the user to click on another row...if they do. 
0
Vlad
Telerik team
answered on 21 Oct 2010, 07:18 AM
Hello,

 Why not use directly CellTemplate and define TwoWay bound CheckBox there? In this case you will need even need to go in edit mode. 

Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Ryan
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Ryan
Top achievements
Rank 2
Share this question
or