Need a pros help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datagrid with 3 columns

Name quantity status

This grid is populated from a sqldatareader.

grid.datasource = datareader
grid.databind()

I now want to set the quantity column to a template column with a
dropdownlist. How can
I get the dropdownlist to be populated from the same sqldatareader but start
a count from 1 to the value of the
quantity field, so if the foll data is returned


testproduct 5 open


the dropdownlist will have

1
2
3
4
5

for the first row so on.

Thanks
 
I'd make the template column in two parts.
1) get all the values into the drop down, using the usual ways
2) loop the values and set the Selected=True when you his the right value.

That make sense? Dont try to think of it as one process, its really two.
A simple function call can set the selected item.
 
Back
Top