Grid With Check box

2 posts, 1 answers
  1. Sunny
    Sunny avatar
    26 posts
    Member since:
    Feb 2013

    Posted 07 Mar 2013 Link to this post

    Hello sir/madam,

    I m using checkbox inside the rad grid and when i checked check boxes and click on button(named Add Selected Items) outside the grid than i want to get check boxes checked either true or false but i always got false value wheather i checked and not so please tell me how to get the check boxes true property when i checked and false when its not checked you can see my screen shot that i have attached and currently i m using below code:


    1.) ( for (int i = 0; i < Grid_PurchaseOrder_Lines_0.MasterTableView.Items.Count; i++)
           {
         bool isChecked = ((CheckBox)Grid_PurchaseOrder_Lines_0.MasterTableView.Items[i].FindControl("chkcmpny")).Checked;}


    2.)     (   foreach (GridDataItem item in Grid_PurchaseOrder_Lines_0.MasterTableView.Items)
         {
                CheckBox chkBoolean = (CheckBox)item["TemplateColumn1"].FindControl("chkcmpny");
                // access your checkbox here

                if (chkBoolean.Checked==true)
                {

                }
            }


    I have used both methods but getting same problem. so please tell me asap.

    thanks in advance........
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Mar 2013 Link to this post

    Hi,

    I was able to replicate the issue when the grid is binded using simple data binding. If you are using simple data binding, try adding !ispostback in the page load handler.

    Thanks,
    Shinu
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top