This is a migrated thread and some comments may be shown as answers.

Referencing RadGrid items collection in Button Click Method

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 05 Jan 2011, 05:22 PM

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ā€¦..

 

}

1 Answer, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 05 Jan 2011, 10:23 PM
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
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Share this question
or