public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
protected void BindGridView()
gvCheckboxes.DataSource = GetDataSource();
protected DataTable GetDataSource()
DataTable dTable = new DataTable();
DataRow dRow = null;
Random rnd = new Random();
for (int n = 0; n < 10; ++n)
dRow = dTable.NewRow();
dRow["sno"] = n + ".";
protected void gvCheckboxes_RowCreated(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow && (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate))
CheckBox chkBxSelect = (CheckBox)e.Row.Cells.FindControl("chkBxSelect");
CheckBox chkBxHeader = (CheckBox)this.gvCheckboxes.HeaderRow.FindControl("chkBxHeader");
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Infogain India Pvt Ltd
Samir NIGAM is a Microsoft Certified Professional. He is an insightful IT professional with results-driven comprehensive technical skill having rich, hands-on work experience n web-based applications using ASP.NET, C#, AJAX, Web Service, WCF, jQuery, Microsoft Enterprise Library , LINQ, MS Entity Framework, nHibernate, MS SQL Server & SSRS.
He has earned his master degree (MCA) from U.P. Technical University, Lucknow, INDIA, his post graduate dipoma (PGDCA ) from Institute of Engineering and Rural Technology, Allahabad, INDIA and his bachelor degree (BSc - Mathematics) from University of Allahabad, Allahabad, INDIA.