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

foreach (GridViewRow with a radGrid?

3 Answers 1395 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 25 Nov 2008, 03:53 PM
With a standard Gridview I can do like this:

  
        foreach (GridViewRow row in GridView1.Rows)
            {

            Label lblAmount = (Label)row.FindControl("lblAmount") as Label;


How do I resolve it with a RadGrid? I'm lost and new with this..

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Nov 2008, 04:01 PM
Hi Markus,

Here is an example:

foreach (GridDataItem item in RadGrid1.Items)
{
   
}

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Markus
Top achievements
Rank 1
answered on 25 Nov 2008, 06:00 PM
thanks but how do I get the reference to:

Telerik.WebControls;

Because now I got this error:

The type or namespace name 'GridDataItem' could not be found (are you missing a using directive or an assembly reference?)  


I only got  Telerik.Web;

How can I make a reference to the webcontrol, and where can I find the dll for that.





0
Princy
Top achievements
Rank 2
answered on 26 Nov 2008, 06:29 AM
Hello Markus,

For the prometheus version of grid(RadGrid for Asp.Net Ajax) the reference should be specified as 'Telerik.Web.UI' whereas Telerik.WebControls is the reference for RadGrid for Asp.Net version.

Thanks
Princy.
Tags
Grid
Asked by
Markus
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Markus
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or