473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

any gridview experts out there!

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.
--
Paul G
Software engineer.
Jun 27 '08 #1
3 991
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

"Paul" wrote:
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.
--
Paul G
Software engineer.
Jun 27 '08 #2
You can include another dropdown to the same template and keep it hidden
until user selects the particular building. In the event that handles user
selection check the logic for enabling the other ddl.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Paul" <Pa**@discussions.microsoft.comwrote in message
news:6C**********************************@microsof t.com...
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.
--
Paul G
Software engineer.

Jun 27 '08 #3
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.
--
Paul G
Software engineer.
"Manish" wrote:
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

"Paul" wrote:
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.
--
Paul G
Software engineer.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ats | last post by:
Not sure if this is the correct place to ask this question. I tried in microsoft.public.dotnet.languages.vb.data but had no reply. I have an aspx page with a gridview on it. The gridview is...
5
by: maurban | last post by:
Hi there experts, I have a gridview with a couple textboxes and a dropdownlist. I'm trying to insert a default value into my database driven dropdownlist. I'm doing this in the rowdatabound...
3
by: Polaris | last post by:
Hi Experts: I'm using asp.net 2.0 with Visual Studio 2005. I'm trying to use the GridView to display data. I need to programmatically add rows into the GridView. So far could not find a way...
1
by: dotNetDummi | last post by:
Hi experts, I need a validator in my gridview. When the user update a field in the gridview, I need to check if the email is valid. How can I do that? Below is my gridview. Please help....
1
by: mghihor | last post by:
Dear GridView Experts! I have problems with GridView when adding a column using TemplateField. I fill GridView1 from a stored procedure. It has a Select statement and returns 14 columns,...
6
by: Steve Harclerode | last post by:
Hi, I'm trying to get my DataGrid to show headers and footers when no rows are returned from the datasource. Below is code that shows the first TemplateField. Is there an easy way to get at...
4
by: Ken Fine | last post by:
I'm making an administrative interface that lists records in a GridView. For *each* row in the gridview, I would there to be two interface elements in addition to some information associated with...
3
by: btreddy | last post by:
Hiii experts , I've received one critical requirement from my customer this morning. I've a gridview,in one of my webpage, which displays all the prticipants who are participating in a...
1
by: btreddy | last post by:
Hii Experts, I've a query about gridview. My requirement is, in one of my webpages there is one gridview which is displaying the participants data like name ,emilid and so on.if the user...
12
by: btreddy | last post by:
Hii Experts, im facing a problem with the javascript validation.i've a gridview in my web form and added a footer tempalte and placed textboxes in tht tempalte ,just to add a new row to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.