Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Reference GridView?

Reply
Thread Tools

Reference GridView?

 
 
staeri@gmail.com
Guest
Posts: n/a
 
      02-15-2006
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

 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      02-15-2006
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


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>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
>



 
Reply With Quote
 
 
 
Reply

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
ASP.NET 2.0: master pages and web user controls: reference to a non-shared member requires an object reference bminder ASP .Net 0 06-24-2005 12:22 AM
asp.net 2005 question re: "reference to a non-shared member requires an object reference" ce ASP .Net 1 06-23-2005 09:15 PM
web reference interfering with reference to component Dude ASP .Net 0 11-09-2004 11:53 AM
How to tell if a reference is project or file reference from within the IDE? Darren ASP .Net 0 10-11-2004 12:51 AM
Passing the value by reference is same as pointer by reference sam pal C++ 3 07-16-2003 09:14 PM



Advertisments