Referencing RadGrid items collection in Button Click Method

2 posts, 0 answers
  1. David
    David avatar
    6 posts
    Member since:
    Jun 2010

    Posted 05 Jan 2011 Link to this post

    Greetings,

    I am able to get a reference to the radGrid,

     

    But in the VS Immediate Window:

     

     

    radGrid.MasterTableView.Items.count

     

    returns zero,

    but I have several rows of data in grid.

    On Postback what am I missing here?

     

    Thanks

     

    Dave G / Ft. Worth Tx.



       protected void btnNext_Click(object sender, ImageClickEventArgs e)

            {

     

     

     

                RadGrid radGrid = FindControl("rdTinExcel") as RadGrid;

     

                foreach (GridDataItem dataItem in radGrid.MasterTableView.Items) 

               {

     

                    // push Rowa that are not Checked in the Grid  

                    if (!(dataItem.FindControl("cbSelectColumn") as CheckBox).Checked)

                    {

     

    Do something here…..

     

    }

  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 05 Jan 2011 Link to this post

    Hello David-

    How are you binding your Grid? Depending on how you're doing databinding, that can affect what's available on PostBack.

    If you can share more details about your databinding configuration, we can quickly provide some guidance that will help you correctly access your rows on postback.

    -Todd
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top