我的代码是这样的:现在我知道如何获取所选行的列名
protected void gv_imageslist_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string status;
string sts;
int result;
lblerror2.Text = "";
//((label)gv.Rows.FindControl("lbl1")).Text;
string str = gv_imageslist.c
if (str == "Status")
{
status = ((Label)gv_imageslist.Rows[e.RowIndex].FindControl("lbl_Status")).Text;
Gm.Gallery_Id = Convert.ToInt32(gv_imageslist.DataKeys[e.RowIndex].Value.ToString());
if (status == "True")
{
Gm.Is_Active = false;
}
else
{
Gm.Is_Active = true;
}
result = Gm.Change_Image_Status();
if (result == 1)
{
Build_ImageGalleryList();
}
else
{
lblerror2.Visible = true;
lblerror2.Text = "Unable to Change Status !";
}
}
else
//------For Checking of cover pic
{
sts = ((Label)gv_imageslist.Rows[e.RowIndex].FindControl("lbl_Cover")).Text;
Gm.Gallery_Id = Convert.ToInt32(gv_imageslist.DataKeys[e.RowIndex].Value.ToString());
string sp = ((Label)gv_imageslist.Rows[e.RowIndex].FindControl("lbl_category_Id")).Text;
Gm.Category_Id = Convert.ToInt32 (sp);
if (sts == "False")
{
Gm.Is_Cover = true;
}
else
{
Gm.Is_Cover = false;
}
result = Gm.Change_Gallery_Cover();
if (result == 1)
{
Build_ImageGalleryList();
}
else
{
lblerror2.Visible = true;
lblerror2.Text = "Unable To Change Cover Pic !!";
}
}
}