By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,938 Members | 2,617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,938 IT Pros & Developers. It's quick & easy.

Populating multiple dropdowns

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> 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.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.