473,804 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1007
Hi Paul,

You can have two dropdownlist control in the same template column and you
can dynamically add another dropdownlist and on its selectedIndexCh anged
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**@discussio ns.microsoft.co mwrote in message
news:6C******** *************** ***********@mic rosoft.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 selectedIndexCh anged
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
1465
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 populated from a datareader which is then closed. When the user clicks a button I want the contents of the gridview to be transferred to another aspx page and be used to fill another gridview. Is this possible? If so how is it done? TIA
5
25356
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 event. My problem is that my code only works for the very first row in the gridview. For the first row, when I press "edit", my gridview goes to edit mode, my textboxes and dropdownlist populate. Further, my dropdownlist has the "Select" I forced in...
3
26287
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 to do it. I appreciate it if any one can show a piece of code doing that.
1
1193
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. Thanks! <asp:GridView ID="gv_retrieve" runat="server" AutoGenerateColumns="False" CellPadding="3"
1
1745
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, AutoGenerateColumns="True". When I add two columns manually to be able to start drag and drop, the drag and drop works OK, but in GridView1_PreRender() and GridView1_RowCreated() I loose values of GridView1.Rows.Cells.Text and e.Row.Cells.Text, these are ""....
6
4538
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 least the footer to show? I want to be able to insert a new row using the footer. Thanks... <asp:GridView ID="gvMaterials" runat="server" AutoGenerateColumns="False" DataSourceID="dsMaterials" ShowFooter="True" Width="100%"
4
3018
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 the record. Those interface elements are a Button and a TextBox. The idea is that the administrator using the interface will fill in an e-mail address and press the button if they want to send that particular record to someone by e-mail. (I know...
3
1659
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 perticular activity with an unique id.Now the requirment is i need to add one button/linkbutton up on ckicking tht i've to dispaly some of the coloums of the gridview in edit mode..in a seperate control.(like in another gridview) and update the...
1
1220
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 wants he can edit the values and update the same in the database also..but before he is commiting the changes to the database i wanna to take the back up of those pervious values(before modifying ). i tried of reading the cell values in the...
12
9907
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 gridview and i wanna to validate the emalid entered in the footertextbox of the gridview. so i added a javasript function : function OnCheckEmailID(srcID) { var email=document.getElementById(srcID); var filter...
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10350
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10096
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7638
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6866
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.