..I still don't have a solution but I've determined part of the problem (at least in the simple two column checkbox scenario, not for user controls).
The
_CellFormatting event fires
before the
_ValueChanging event and does not fire after the values have changed.
Surely the
_CellFormatting should fire
after the
ValueChanging, or
before and
after? (or better, only if it needs to)
When a user ticks a RadCheckBox, I want to format columns appropriately in the _
CellFormatting event
, but because _
CellFormatting fires before the value is changed, and doesn't fire after, I only have the old, and therefore, incorrect values in the grid to check and so the elements are formatted incorrectly.
arrrgh.
I've tired with hooking the _CellBeginEdit and _CellEndEdit events too and get some pretty strange results. Sometimes the
CellEndEdit event doesn't even fire - particulally when you toggle the same CheckBox from ticked to unticked or visa versa - but it does fire if you click on another row then back.
I was able to reproduce the same effect by editing the WinControls.GridView.Events telerik example code, using the (hidden) BMP
checkbox column for testing.
radGridView1.ValueChanging += new Telerik.WinControls.UI.ValueChangingEventHandler(radGridView1_ValueChanging); |
|
void radGridView1_ValueChanging(object sender, ValueChangingEventArgs e) |
{ |
AddTextToListBox(string.Format("Value Changing")); |
} |
|
void radGridView1_CellFormatting( object sender, CellFormattingEventArgs e ) |
{ |
if (e.CellElement is GridCommandCellElement) |
{ |
e.CellElement.Text = "Btn " + e.CellElement.RowInfo.Cells[ "Id" ].Value; |
} |
AddTextToListBox(string.Format("Cell formatting")); |
} |
|