using System.Web.UI;
using System.Web.UI.WebControls;

namespace GridView_Pagination
{
    /// <summary>
    /// Item template: renders a single CheckBox per data row.
    /// ID="chk" is used by FindControl in RowDataBound and CheckAll_Click.
    /// </summary>
    public class CheckBoxTemplate : ITemplate
    {
        public void InstantiateIn(Control container)
        {
            var cb = new CheckBox();
            cb.ID = "chk";
            // onclick wired in RowDataBound so it has access to the row's ID.
            container.Controls.Add(cb);
        }
    }
}