Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Populating multiple dropdowns

Reply
Thread Tools

Populating multiple dropdowns

 
 
=?Utf-8?B?QW5keQ==?=
Guest
Posts: n/a
 
      04-21-2005
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
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      04-21-2005
> 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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating dropdowns client-side? Anup ASP .Net 2 06-20-2006 01:44 PM
Populating dropdowns client-side? Anup ASP .Net Web Controls 0 06-20-2006 09:32 AM
Help, Populating dropdowns via subroutine Paul D. Fox ASP .Net 1 08-25-2005 12:47 PM
Populating DropDowns sck10 ASP .Net 4 11-15-2004 12:44 PM
Populating multiple textboxes with multiple records for update page Drew ASP General 7 11-10-2004 02:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57