using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Page_PreRenderComplete(object sender, EventArgs e)
    {
        HiddenField2.Value = disabledNbr.ToString();
    }


    int disabledNbr = 0;
    protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        //disable each odd item check box
        if (e.Item.ItemType == GridItemType.Item)
        {
            GridDataItem item = (GridDataItem)e.Item;
            CheckBox checkBox = (CheckBox)item["ClientSelectColumn"].Controls[0];
            checkBox.Enabled = false;
            disabledNbr++;
        }
        if (e.Item.ItemType == GridItemType.Header)
        {
            GridHeaderItem header = (GridHeaderItem)e.Item;
            CheckBox checkBox = (CheckBox)header["ClientSelectColumn"].Controls[0];
            HiddenField1.Value = checkBox.ClientID;
            disabledNbr = 0;
        }
    }
}