Rad1
asked on
How to call ASP.NET event from another event
Hello,
How can I call "GridView1_SelectedIndexCh anging(obj ect sender, System.Web.UI.WebControls. GridViewSe lectEventA rgs e)" from
"protected void GridView1_RowEditing(objec t sender, GridViewEditEventArgs e)"
Thank you!!!
How can I call "GridView1_SelectedIndexCh
"protected void GridView1_RowEditing(objec
Thank you!!!
ASKER
Can you please elaborate with example?
Thank you!
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How can I call this code from
protected void GridView1_RowEditing(objec t sender, GridViewEditEventArgs e)
protected void GridView1_RowEditing(objec
int i = 0;
foreach (GridViewRow gr in GridView1.Rows)
{
CheckBox cb = (CheckBox)gr.Cells[1].FindControl("ChkBx1");
if (cb.Checked == false)
{
if (!IsPostBack)
{
GridView1.Columns[i].Visible = false;
}
}
}
ASKER
Thank you!!!
Just write the code you want into a private method and call that method.
Won't this work for you?