473,796 Members | 2,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Beginner gridview question

Just wondering if anyone knows if this is possible with a gridview but I have
a template column with two dropdown list boxes in it and when the user makes
a selection in the first box I want to run an event that then takes the
selected value of the first dropdown and feeds it into a stored procedure
that returns a dataset that I want to display in the second dropdown list.
If there is no data returned I want to hide the second dropdown list, any
examples, thanks. I was doing this quite easily with the controls outside of
the datagrid.
Thanks.
--
Paul G
Software engineer.
Jul 2 '08 #1
2 1170
jm
On Jul 2, 4:06*pm, Paul <P...@discussio ns.microsoft.co mwrote:
Just wondering if anyone knows if this is possible with a gridview but I have
a template column with two dropdown list boxes in it and when the user makes
a selection in the first box I want to run an event that then takes the
selected value of the first dropdown and feeds it into a stored procedure
that returns a dataset that I want to display in the second dropdown list.. *
If there is no data returned I want to hide the second dropdown list, any
examples, thanks. *I was doing this quite easily with the controls outside of
the datagrid.
Thanks.
--
Paul G
Software engineer.
If you make them template columns, you can reference them in code
easier, which may be what you did outside of the datagrid you
mentioned.
Jul 2 '08 #2
Thanks for the response. I think something like below may work as I am able
to access the selected values in the template column. There is also a label
in the column as well. I will just need to rebind the secondary dropdown
feeding the selected value into the datasource first.

protected void drdn1_SelectedI ndexChanged(obj ect sender, EventArgs e)
{
foreach (GridViewRow myRow in this.gvwDiscrep ancies.Rows)
{
Label lbl1 = myRow.Cells[2].Controls[1] as Label;
DropDownList drdn1 = myRow.Cells[2].Controls[7] as DropDownList;
if (drdn1 != null)
{
string stemp = drdn1.SelectedV alue.ToString() ;
}
}
}
--
Paul G
Software engineer.
"jm" wrote:
On Jul 2, 4:06 pm, Paul <P...@discussio ns.microsoft.co mwrote:
Just wondering if anyone knows if this is possible with a gridview but I have
a template column with two dropdown list boxes in it and when the user makes
a selection in the first box I want to run an event that then takes the
selected value of the first dropdown and feeds it into a stored procedure
that returns a dataset that I want to display in the second dropdown list..
If there is no data returned I want to hide the second dropdown list, any
examples, thanks. I was doing this quite easily with the controls outside of
the datagrid.
Thanks.
--
Paul G
Software engineer.

If you make them template columns, you can reference them in code
easier, which may be what you did outside of the datagrid you
mentioned.
Jul 2 '08 #3

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

Similar topics

3
5677
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the GridView to allow entry of quantity and Y/N switch for
6
3041
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the current_row_key of Grid1... to the objectDataSource2 parameter? (so that the second grid, gets only the information to do with current row of grid1)
4
2619
by: Nalaka | last post by:
Hi, I have two questions about gridViews. 1. How can I intercept the row/column values at loading to change values? 2. After I update a row (using default update functionality), how can I re-format the updated row fields. I have looked at gridView.rowUpdated method, but cannot figure out how....
7
14821
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I want to look at that data and filter it based on what is in it. I know that this could have been done with data sets and data views in asp.net 1.1 but how is this done now in asp.net 2.0?
1
3250
by: Giovanni | last post by:
Dear Friends/Gurus, I have exhausted myself and have yet no solution to the following: I have an ASP.NET 2.0 Survey type application. On a page, I have placed a GridView which is bound to an SQLDataSource. The GridView contains 3 columns: QuestionNumber, QuestionText, and a TemplateField. Each row in the GridView represents a question in a table (Ex.: "18. Satisfaction Level").
1
1092
by: DelphiLover | last post by:
Hi. This should be a walk in the park for almost anyone... I'm a skilled win32 programmer, trying to learn asp.net 2.0 I've tried making a XML file parsing it to draw a GUI (web application) I have a small example: <?xml version="1.0" encoding="utf-8" ?>
1
8581
by: Barry L. Camp | last post by:
Hi all, Wondering if someone can help with a nagging problem I am having using a GridView and an ObjectDataSource. I have a simple situation where I am trying to delete a row from a table, but it doesn't seem to work at all. Below is my ASP.NET page, and further below, my VB.NET method that I am trying to call: <div id="admin-faq" class="page"> <h2>Site FAQs (Frequently Asked Questions)</h2>
2
1489
by: Riaaaa | last post by:
I m beginner for ASP.Net 2005 with C# and SQL Server 2005. I have created the form which contains many asp standard controls on it like label,textbox,checkbox,dropdownlist,command button. The command button used are only to execute the different queries on click event. I have put the GridView control which is used to show the database stored related to that form. I m using SQL DataSource control for the connection. Now,my problem is i m...
12
2182
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a test page and I've managed to bind the usercontrol to a repeater and display some data in the following fashion: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource1"> <ItemTemplate > <uc1:AUserControl runat="server"...
0
9680
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
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
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...
1
10174
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10012
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
7548
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
6788
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();...
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
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.