J
Jim Bancroft
Hi everyone,
I'd like to put some DropDownLists in my DataGrid, populating each from a
database query. I'm having a little trouble naming them based on the
current record in the DataSet.
For example, here's a snippet of what I have now in my DataGrid
<ItemTemplate>
<aspropDownList runat="server" id="lstCategories"
DataValueField="CategoryID"
DataTextField="Name"/>
</ItemTemplate>
I can create the DropDownLists ok, but I'm stuck choosing one id for the
name, and having the DataGrid supply the final name for each. I'd like to
name them myself, giving them ids like "lstCategories0," "lstCategories1,"
"lstCategories2," etc. Is it possible to do that somehow?
And, if I can do it, how can I set their DataSource properties and selected
items in my code-behind file? The goal is to have each DropDown reading
from the same data source, but with their selected item dependent on their
id values.
Thanks very much,
-Jim
I'd like to put some DropDownLists in my DataGrid, populating each from a
database query. I'm having a little trouble naming them based on the
current record in the DataSet.
For example, here's a snippet of what I have now in my DataGrid
<ItemTemplate>
<aspropDownList runat="server" id="lstCategories"
DataValueField="CategoryID"
DataTextField="Name"/>
</ItemTemplate>
I can create the DropDownLists ok, but I'm stuck choosing one id for the
name, and having the DataGrid supply the final name for each. I'd like to
name them myself, giving them ids like "lstCategories0," "lstCategories1,"
"lstCategories2," etc. Is it possible to do that somehow?
And, if I can do it, how can I set their DataSource properties and selected
items in my code-behind file? The goal is to have each DropDown reading
from the same data source, but with their selected item dependent on their
id values.
Thanks very much,
-Jim