Populating multiple dropdowns

G

Guest

What I want to do is to populate multiple dropdowns when editing.
Presumably...
a) I should use a DataReader so that I can get each ResultSet for each
dropdown control, and that should cut down round trips to the server.
b) I should populate these dropdowns in the DataGrid_EditCommand?
What I am having problems with is actually referencing the dropdowns on the
template.
e.g. I have a dropdown called drpAccessLevels, but I cannot find this
anywhere.
Where am I going wrong?

Many thanks in advance.
Andy
 
B

Brock Allen

a) I should use a DataReader so that I can get each ResultSet for each
dropdown control, and that should cut down round trips to the server.

Only as long as you're building a batch SQL statement (like "select * from
foo; select * from bar") and not calling ExecuteReader twice. Each ExecuteReader
makes a trip to the DB.
b) I should populate these dropdowns in the DataGrid_EditCommand?
What I am having problems with is actually referencing the dropdowns
on the
template.
e.g. I have a dropdown called drpAccessLevels, but I cannot find this
anywhere.

Typically you'd do any additional modifications of the row in ItemDataBound
event off the grid. So then when the DataGridItemEventArgs.Item.ItemType
== ListItemType.EditItem then you know you're working with the editable row.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top