User (Old forums)MemberMarch 17, 2007 at 1:08 amPost count: 23064
I have a custom IBindingList collection which I bind to the grid. The problem is that if I have objects in it which have nullable type properties then the values set in the cells are not committed.
Please suggest a workaround.
Imported from legacy forums. Posted by Hemanshu (had 3930 views)User (Old forums)MemberMarch 19, 2007 at 3:46 pmPost count: 23064
The editors do not support nullable data types. You need to subscribe to the SettingControlValue and GettingControlValue on the editors so that you can make the proper conversion, depending on the data type of the column.
You will find an example of each event form the following help documentation pages :
Imported from legacy forums. Posted by André (had 306 views)User (Old forums)MemberJune 7, 2007 at 2:29 pmPost count: 23064
I did override the GetControlValueCore and all works fine…but is it possible to commit the value of the checkbox as soon as the checkstate changes? I dont want to wait until the user exits the cell or presses enter…how do i do that?
Imported from legacy forums. Posted by Pitrick (had 354 views)User (Old forums)MemberJune 11, 2007 at 3:22 pmPost count: 23064
This is only possible if you make the column ReadOnly, and change the value through code in the click event handler, or in the KeyUp event handler of the SpaceBar/Enter/whatever…
Imported from legacy forums. Posted by André (had 260 views)User (Old forums)MemberJune 12, 2007 at 6:54 amPost count: 23064
Another option is to catch the CheckStateChanged-event on the editor control, and in the event handler call LeaveEdit on the cell:<pre>WinCheckBox lCheckBox = sender as WinCheckBox;
GridControl lGrid = lCheckBox.Parent.Parent as GridControl;
Cell lCell = lGrid.CurrentCell;
if (lCell != null) lCell.LeaveEdit(true);</pre>
Imported from legacy forums. Posted by Tommy (had 542 views)
- You must be logged in to reply to this topic.