I have a GridView with some bound data. I have an unbound checkbox on the first column... This checkbox simply acts as a marker for further processing... eg on all checked rows, data is saved when a button is pressed...
On change of each checkbox I need to run some validation... which I won't go into here...So I use the event MyGridView_ValueChanged(object sender, EventArgs e).
From this event I use the following code to go through each row and find all the checked checkboxes...
foreach(GridViewRowInfo gvri in MyGridView.Rows)
{
if (Convert.ToBoolean(gvri.Cells["chkSelected"].Value) == true)
{
// Happy Days
}
}
Even though checking this checkbox fires the ValueChanged event, when this code is run, there are no values that return true for the checkboxes. If I select another checkbox, the first one now appears as true, but the one I just selected remains false... Why does this not show the changed value in the grid? Also can you advise if this is possible using any other events / properties?
Thanks