I need to find count of total number of columns in a gridview inside the event rowdatabound .Is there any way for it. Below is my few code:
protected void gvEmployee_RowDataBound(object sender, GridViewRowEventArgs e)
{
LinkButton lnkView = new LinkButton();
lnkView.ID = "lnkView";
lnkView.Text = "View";
lnkView.Click += ViewDetails;
e.Row.Cells[3].Controls.Add(lnkView);
}
Pravesh Singh
27-Nov-2014You can cast sender to GridView and get the count.