GridView BoundField Control Names

  • Thread starter Thread starter GridView Newbie
  • Start date Start date
G

GridView Newbie

Is there a way to explicitly name BoundFields in a GridView? The controls
are getting names like "ctl10". There is one control that I would like to
name "LocationType" so I can pass that string into FindControl() instead of
the meaningless "ctl10".

Thanks for the help.
 
For FindControl you are using control ids, not client ids. But anyway you
can't use FindControl to locate a BoundField. FindControl is good for
templates. You can data from Cells collection of the row or you may use
DataItem to get the column values as they come from the database.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 

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