私の Button1 は Panel 内にあります。その Imagebutton を非表示にするために、rowindex にアクセスしたいと思います。しかし、デバッグ モードに入ると、GridView1.SelectedIndex の値が null になります。助けてください!
protected void Button1_Click1(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
if (row.RowIndex == Convert.ToInt32(GridView1.SelectedIndex))
{
ImageButton StopButton = (ImageButton)row.FindControl("stopImageButton");
ImageButton StartButton = (ImageButton)row.FindControl("startImageButton");
StopButton.Visible = true;
StartButton.Visible = false;
}
}
}
this.StopTimeNotesPanel_ModalPopupExtender.Hide();
}