Vasanth Jack

Vasanth Jack

  • NA
  • 289
  • 35.5k

When We click a button I want to get the chechbox ChekedID

Jan 31 2017 9:54 AM
When We click a button I want to get the chechbox ChekedID Which is Inside the Row databound
 
I will create a checkbox inside the Rowdatabound
 
I have one button When we click a button i want to get the checkbox values. 
 
 
CheckBox checkBox;

protected void grdBindExcel_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
for (int i = 0; i < e.Row.Cells.Count; i++)
{
checkBox = new CheckBox();
//checkBox.CssClass = "headerCheckBox";
string val = e.Row.Cells[i].Text;

checkBox.Text = val.ToString();
checkBox.ID = Convert.ToInt32(i).ToString();
e.Row.Cells[i].Controls.Add(checkBox);
checkBox.AutoPostBack = false;
checkBox.CheckedChanged += SelectCheckBox_OnCheckedChanged;
}
}
}
 
 
 

Answers (1)