Doubt template

P

Paulo

Hi, inside a template field, ItemTemplate, on a GridView, I have a combobox,
but how can I fill it only on first time before filling the gridview rows?
Im usvig VS 2005 asp.net 2.0 C#??

Thanks
 
M

Muhammad Naveed Yaseen

Perhaps the best way is to bind it with a DataSource Control (e.g.
ObjectDataSource or SqlDataSource). That would take care of details
like 'when, how, where' and caching. Please note that DataSource
controls are bound by propertie DataSourceID (and not DataSource).

Alternatively you may hook up RowCreated event and get manual access
by e.Row.FindControl (after ensuring its a data row by e.Row.RowType
== DataControlRowType.DataRow).
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top