Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Loop through multiple Datagrids on page

Thread Tools

Loop through multiple Datagrids on page

Posts: n/a
I have 4 datagrids (dg1, dg2, dg3, and dg4) on a webpage. I know how to
loop through the rows in each individual datagrid, but I need to loop
through all 4. Is there a way to loop through the controls on the page,
determine if it is a datagrid or not, then I can continue my loops? I have
tried using Page.Controls, but that only gives me the "literals." Any
suggestions? Code Samples would be great help.

Thanks in advance for any shared knowledge!
Chuck Foster
Programmer Analyst
Eclipsys Corporation - St. Vincent Health System

Reply With Quote
Teemu Keiski
Posts: n/a

yes it is, it just need recursive approach (to note that controls can
contain another controls and so on). Check this:

Loop through all or certain type of controls on the ASP.NET Page

Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
multiple datagrids on same page paging broken TJ ASP .Net Web Controls 1 06-16-2006 06:08 AM
Loop through multiple Datagrids on page chuckdfoster ASP .Net 1 07-01-2005 05:36 PM
Export multiple datagrids on web page to Excel Steve Chatham ASP .Net 0 02-24-2004 07:23 PM
Displaying Multiple Datagrids on one page Dennis Davitt ASP .Net Datagrid Control 1 12-30-2003 09:46 PM