Reference GridView?

  • Thread starter Thread starter staeri
  • Start date Start date
S

staeri

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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top