
Shane Holder
Top achievements
Rank 1
Shane Holder
asked on 04 Jun 2011, 03:09 PM
Is there a way to get the GridViewCheckBoxColumn to commit changes to its source without having to exit the cell? I am trying to induce some behavior in a ViewModel when a property is changed, but I do not receive the INotifyPropertyChanged event until the user changes the selected cell. Using a GridViewDataColumn with a CellTemplate gives the INPC event when the checkbox is changed, however I do not get a SelectionChanged event from the Grid so I don't have an opportunity to wire up the INPC handler for the selected object.
Thanks,
Shane Holder
Thanks,
Shane Holder
6 Answers, 1 is accepted
0
Hello Shane Holder,
I have prepared a sample project for your case. Please, refer to it and let me know whether this approach meets your requirements.
Greetings,
Ivan Ivanov
the Telerik team
I have prepared a sample project for your case. Please, refer to it and let me know whether this approach meets your requirements.
Greetings,
Ivan Ivanov
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

Shane Holder
Top achievements
Rank 1
answered on 06 Jun 2011, 02:28 AM
I don't believe that you need the CheckBox_Click event, when using a checkbox control inside the Cell Template it will commit to source as soon as it is checked. I was trying to use the CellTemplate so that I would not require the user to click the cell multiple times to change the checkbox state, I noticed that you used CellEditTemplate which performs the selected row. Is there a way to do both, and have the checkbox only require a single click and get selected row?
Thanks for your help,
Shane Holder
Thanks for your help,
Shane Holder
0
Hi Shane Holder,
I have modified the example, utilizing another approach. Now it takes only one click to update a cell's value. I have attached it for your reference.
Greetings,
Ivan Ivanov
the Telerik team
I have modified the example, utilizing another approach. Now it takes only one click to update a cell's value. I have attached it for your reference.
Greetings,
Ivan Ivanov
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

Shane Holder
Top achievements
Rank 1
answered on 06 Jun 2011, 05:52 AM
Clever, thanks. The only change I made was to use the MyCheckBoxColumn's DataMemberBinding property. I would think this would be the normal behavior one would want out of the box when working with a grid, any chance of getting this in the next release?
public class MyCheckBoxColumn : GridViewCheckBoxColumn
{
public override FrameworkElement CreateCellEditElement(GridViewCell cell, object dataItem)
{
var element = base.CreateCellEditElement(cell, dataItem);
(element as CheckBox).SetBinding(CheckBox.IsCheckedProperty, this.DataMemberBinding);
return element;
}
}
0
Hello Shane Holder,
Unfortunately you will have to stick to this workaround, since such a behavior contradicts with RadGridView's main principles of data processing. Source shouldn't be updated, before CommitEdit is executed and all the validation checks are positive.
Kind regards,
Ivan Ivanov
the Telerik team
Unfortunately you will have to stick to this workaround, since such a behavior contradicts with RadGridView's main principles of data processing. Source shouldn't be updated, before CommitEdit is executed and all the validation checks are positive.
Kind regards,
Ivan Ivanov
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

Shane Holder
Top achievements
Rank 1
answered on 13 Jun 2011, 09:46 PM
I agree that validation must be done before committing the edit, however the default behavior of requiring a user to click 3 times in order to edit an element is non-intuitive, and there seem to be several workarounds required in order to get an acceptable end-user experience. I hope that the product team will consider making the grid easier to setup with an expected end user experience. The enduser feedback I always get when working with 3rd party grids is make it work like Excel, perhaps an ExcelMode? :)
Thanks,
Shane
Thanks,
Shane