any gridview experts out there!

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Not sure if this is possible with a gridview but I have several template
columns and if possibly I want to conditionally add a second dropdownbox to
the same column, for each row. For example column 1 contains a dropdown box
called buildings and is loaded by a an object data source. This works fine
but with some of the data there will be a group of rooms for some buildings
so when the user selects a particular building that contains a room subset I
would like to then have the room dropdown box appear with the corresponding
rooms, in the same column of the building dropdown. It looks easy to do in
its' own column but I am running out of space. Not sure if you can have two
controls in a single template column or if there is another way to do this,
using vs2005 C#?
Thanks.
 
Hi Paul,

You can have two dropdownlist control in the same template column and you
can dynamically add another dropdownlist and on its selectedIndexChanged
event bind it to the another datasource based on the value selected in the
first dropdown. Please make sure that you have unique ids of the control in
the same Template column. you will have to dynamically assign unique id to
the Dropownlist control.

Regards,
Manish
www.ComponentOne.com
 
Hi thanks for the responses, looks like I was able to add a secondary
dropdown list. So thinking for the hidden list the default visible with be
false, just wondering what the event would be for the first drowdown to make
the second one visible? If they were outside the grid it would just be the
click event for the first dropdown.
 
Back
Top