472,119 Members | 1,490 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 1366
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 OnSelectedValueChanged 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*******@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.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 OnSelectedValueChanged 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*******@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.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 ucThreeDropDowns. 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.SelectedValue.

"CSharpguy" <CS*******@discussions.microsoft.com> wrote in message
news:94**********************************@microsof t.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 OnSelectedValueChanged 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*******@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Martial Spirit | last post: by
8 posts views Thread by Kim14 | last post: by
2 posts views Thread by Woody Splawn | last post: by
2 posts views Thread by laredotornado | last post: by
reply views Thread by leo001 | last post: by

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.