Hi, I'm using the latest version of the winform controls. My grid has a checkbox and some text columns.
when a user clicks a checkbox in one column, I want to place a value into one of the text columns on the same row.
I've experimented with the ValueChanged and ValueChanging events but it's not obvious how to achive this from the documentation.
it's almost working but for some reason my checkboxcell value always returns nothing.. inspected it looks like {} . The field changes in the UI quite ok, and accessing it later (via a save button on the form) in the same format gives me the correct value, but just not in the changing events?!
inspecting or setting the other columns is no problem either.
firstly, am I going about this the right way?
While i'm here I should also ask how to stop the changing events firing on demand? (when I first load the data i databind then update some fields, and I note the events firing when I programmatically update, no doubt there is an easy way to prevent this without unhooking the event handler).
cheers
ewart
when a user clicks a checkbox in one column, I want to place a value into one of the text columns on the same row.
I've experimented with the ValueChanged and ValueChanging events but it's not obvious how to achive this from the documentation.
it's almost working but for some reason my checkboxcell value always returns nothing.. inspected it looks like {} . The field changes in the UI quite ok, and accessing it later (via a save button on the form) in the same format gives me the correct value, but just not in the changing events?!
inspecting or setting the other columns is no problem either.
firstly, am I going about this the right way?
While i'm here I should also ask how to stop the changing events firing on demand? (when I first load the data i databind then update some fields, and I note the events firing when I programmatically update, no doubt there is an easy way to prevent this without unhooking the event handler).
if (sender is GridCheckBoxCellElement) |
{ |
GridCheckBoxCellElement g = (GridCheckBoxCellElement)sender; |
MyObject o = (MyObject)g.RowInfo.DataBoundItem; |
row = g.RowInfo; |
if (row.Cells["checkboxcell"].Value.ToString() == "False" ) |
{ |
row.Cells["othertextcell"].Value = ""; |
} |
else |
{ |
row.Cells["txtKeyWord"].Value = o.myproperty; |
} |
} |
cheers
ewart