[RESOLVED] find the controls in the gridview if the gridview.rows.count=o

I have designed a gridview in the aspx page.In the Code Behind I could not find controls in the gridview because the gridview.rows.count=o as the gridview is not binded before.

How do i find the controls in the gridview if the  gridview.rows.count=o?

Which event you are using to write the find control code?

after binding only u can get the data...before it will be 0 only know....!

after binding the data to gridview , try to count!

all the best!

sudhir.kathuria

Which event you are using to write the find control code?

 Dim tb As Label = DirectCast(Grd_List_of_Values.Rows(i).Cells(1).FindControl("lblID"), Label)

But i need to add the dataset set values to the labels,textboxes in a gridview on button_click.

BUT THESE LABELS,TEXTBOXES ARE EMPTY ITEM  TEMPLATES

I advise you to google/bing gridview and learn how it works. The general idea is that you set a template of what the GV will look like, and then you databind it to a DataSource to fill the contents. Might check this: http://msdn.microsoft.com/en-us/library/bb288032.aspx. Or search for other pages.

thoughts on "[RESOLVED] find the controls in the gridview if the gridview.rows.count=o"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>