Mark
Thu May 08 09:34:51 CDT 2008
"Wannabe" <Wannabe@discussions.microsoft.com> wrote in message
news:60CA5B12-682D-44E8-95CE-E4639D7303EC@microsoft.com...
> I have a gridview that has a label field and a checkbox field in it. I
> have
> the checkbox set to autopost when changed. How can I get the datakey value
> that is assigned to that row when a checkbox is either checked or
> unchecked?
protected void MyCheckBox_OnCheckedChanged(object sender, EventArgs e)
{
int intDataKey =
Convert.ToInt32(MyGridView.DataKeys[((GridViewRow)((CheckBox)sender).Parent.Parent).RowIndex].Value);
// rest of code
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net