Groups | Blog | Home
all groups > asp.net > february 2006 >

asp.net : Reference GridView?



staeri NO[at]SPAM gmail.com
2/14/2006 11:26:00 PM
I want to count the rows in a GridView which is nested into a DataList
but I can't find the correct syntax for this.

Can someone please help me with this and also tell me how to reference
a text box control in the nested grid?

Regards,

Staeri
Teemu Keiski
2/15/2006 8:45:06 PM
Hi,

you could for example iterate the DataList

'Iterate every item in DataList
For each litem As DataListItem in DataList.Items

Dim gw As GridView = DirectCast(litem.FindControl("GridView1"),GridView)
'Count is gw.Items.Count

Next

Getting at TB inside GridView is similar task, you'd need to run FindControl
against GridViewRow(s)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke


[quoted text, click to view]

AddThis Social Bookmark Button