473,569 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

drop downs in userControls

I have 3 drop downs that are populated from the databasem 4 of my web pages
need to have this drop down, how can I trap the selection made in the drop
down and popuate my grid on my form?
May 12 '06 #1
3 1464
Hi CSharpguy,

I'm not quite sure what you mean by "trap". Do you mean you just want to
expose the selected value to the web form containing the user control? If
that's the case, just create three public or internal properties in the
control representing the selected values of each dropdown. Once you
initialize this control on your form, you'll have access to those
properties.

Another option is to pass the OnSelectedValue Changed event to bubble up to
the web form so it can't react to the user control's event. If you'd like
to elaborate, I could probably help out more.

"CSharpguy" <CS*******@disc ussions.microso ft.com> wrote in message
news:6A******** *************** ***********@mic rosoft.com...
I have 3 drop downs that are populated from the databasem 4 of my web pages
need to have this drop down, how can I trap the selection made in the drop
down and popuate my grid on my form?

May 12 '06 #2
i have 3 drop downs (in auser control) i have a grid on the web form, when
the user selects a item in the drop down, and then presses the search button,
I want to take what they have selected and run my sql query and then bind my
grid on my page with the data linked to the drop down selection. I only want
the drop downs in a user control

"Michael Bosch" wrote:
Hi CSharpguy,

I'm not quite sure what you mean by "trap". Do you mean you just want to
expose the selected value to the web form containing the user control? If
that's the case, just create three public or internal properties in the
control representing the selected values of each dropdown. Once you
initialize this control on your form, you'll have access to those
properties.

Another option is to pass the OnSelectedValue Changed event to bubble up to
the web form so it can't react to the user control's event. If you'd like
to elaborate, I could probably help out more.

"CSharpguy" <CS*******@disc ussions.microso ft.com> wrote in message
news:6A******** *************** ***********@mic rosoft.com...
I have 3 drop downs that are populated from the databasem 4 of my web pages
need to have this drop down, how can I trap the selection made in the drop
down and popuate my grid on my form?


May 12 '06 #3
Right. Create the user control, let's say ucThreeDropDown s. Drag this
control to the form designer. Now in your code behind initialize that
control Make sure the name of the object matches the ID of the control on
the web form. You will now be able to access the properties of the
dropdowns.
internal ucThreeDropDown uc;
On the OnClick event of the submit button, just use the object to get the
dropdown values. ie. uc.DropDown1.Se lectedValue.

"CSharpguy" <CS*******@disc ussions.microso ft.com> wrote in message
news:94******** *************** ***********@mic rosoft.com...
i have 3 drop downs (in auser control) i have a grid on the web form, when
the user selects a item in the drop down, and then presses the search
button,
I want to take what they have selected and run my sql query and then bind
my
grid on my page with the data linked to the drop down selection. I only
want
the drop downs in a user control

"Michael Bosch" wrote:
Hi CSharpguy,

I'm not quite sure what you mean by "trap". Do you mean you just want to
expose the selected value to the web form containing the user control?
If
that's the case, just create three public or internal properties in the
control representing the selected values of each dropdown. Once you
initialize this control on your form, you'll have access to those
properties.

Another option is to pass the OnSelectedValue Changed event to bubble up
to
the web form so it can't react to the user control's event. If you'd
like
to elaborate, I could probably help out more.

"CSharpguy" <CS*******@disc ussions.microso ft.com> wrote in message
news:6A******** *************** ***********@mic rosoft.com...
>I have 3 drop downs that are populated from the databasem 4 of my web
>pages
> need to have this drop down, how can I trap the selection made in the
> drop
> down and popuate my grid on my form?
>
>


May 12 '06 #4

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

Similar topics

46
5111
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") to populate a drop down but would like to use several drop downs restricting the contents of each drop down to the records pertaining to one
1
4661
by: Martial Spirit | last post by:
Hello- I was amazed at the suckerfish drop-downs from AListApart.com. They work great except for one thing, if I position the drop-downs over an iframe element, on mouseover the menus disappear. It works fine in IE, but not FireFox. I would like to implement these menus, but if I can't get this to work, I gotta look at something else. If...
8
2028
by: Kim14 | last post by:
Help! I am trying to create a webpage and it would be obvious to anyone who reads my source code (it's a mess) that I created it using a template. I know almost nothing about webpages, but am happy with all but a few bugs in my page. I have read many posts about opening drop-downs in new windows, and have spent hours looking over my...
1
2142
by: Joe Dunleavy | last post by:
Hi Guys, Hopefully some one will have come across this issue already. I have a DataGrid inside a Div where a scroll bar displays once a certain height is meet --> <div id="dvSales" style="height: 230px; overflow: auto; width: 100%" runat="server"> The Data Grid has AllowPaging is set to False and the HeaderStyle tag is set for the...
2
1408
by: Woody Splawn | last post by:
I have a question about technique with regard to filling drop downs. I have a Winform that has several different tabs and tables associated with it. In an effort to keep the load time small I would like to not fill the fields with lookups at form load time. I have a grid on a tab of this form that has six fields in it that have lookups...
2
3620
by: John | last post by:
I have CSS drop down navigatoon bar and it works fine. However, when I have page where I have an <embed - needed to show a PDF file, such as: <embed src="Security.pdf" width="900" height="500"></embed> When the mouse passes over the navigation bar, the drop downs are hidden behind the PDF page.
0
874
by: ehsanen | last post by:
I have some text boxes and drop downs on my web page and now i want to put a button in my webpage that when the user clicked the buton the page itself add another row of textboxes and drop downs , in fact i want to simulate sth like new table creation of sql server in my webpage. is there any solution in c# for this problem?
2
1481
by: laredotornado | last post by:
Hi, If any of you have a Google home page ... http://www.google.com/ig you'll notice that when you click on the drop down arrow graphic for each module, there is a drop down menu that appears. You can move the module around the page and the drop down menu always appears under the arrow. Does anyone have any recommendations as the best...
1
1349
by: JackInDaBox | last post by:
Hello, I am new to this and have run into a small problem. I am using the Ajax toolkit with VS 2005 to fill some drop downs through a web service and it works great. All of the cascading drop downs work correctly. The only problem I have is I need to copy the drop downs value from each cascading drop down into a hidden drop down. I have...
0
7697
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...
0
7612
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...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
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...
1
7672
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...
0
3653
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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...

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.