here is the senerio:
I have a GridView on a Web Form. The GridView DataSourceID is using a
SqlDataSource to populate the rows in the GridView. The fields returned by
the datasource are: id, month, year. So the rows look somthing like this:
1 1 2003
2 5 2006
3 2 2006
First I changed the year column control in the GridView to a template field
and use a Dropdown. Now I need to add items to the dropdown list for each
row in the GridView to read somthing like this:
row 1 dropdown:
value text
2003 2003 selected
2006 2006
2007 2007
2008 2008
2009 2009
row2 dropdown:
2006 2006 selected
2007 2007
2008 2008
2009 2009
so on and so on
I'm not sure where I actually accomplish this. in the DataBound event, in
the RowAdded event. And then How this is accomplished.
Thanks
"Patrice" <sc****@chez.com> wrote in message
news:ur**************@TK2MSFTNGP04.phx.gbl...
Just add 1 until the needed year ? What is the exact problem with what you
tried ? (add the items, looping for years, adding the combo etc...)
--
"Advertis" <ad******@snpent.com> a écrit dans le message de news:
kq***************@tornado.tampabay.rr.com... Is there a way to populate a dropdown in a GridView with the next x
years?
I am using a GridView to display data from a SQL table One of the fields
is a Year. I want to have the dropdown list not only the year in the db
field, but also the current year to the next x years.
Any ideas?