Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > drop downs in userControls

Reply
Thread Tools

drop downs in userControls

 
 
=?Utf-8?B?Q1NoYXJwZ3V5?=
Guest
Posts: n/a
 
      05-12-2006
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?


 
Reply With Quote
 
 
 
 
Michael Bosch
Guest
Posts: n/a
 
      05-12-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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?
>
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q1NoYXJwZ3V5?=
Guest
Posts: n/a
 
      05-12-2006
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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?
> >
> >

>
>
>

 
Reply With Quote
 
Michael Bosch
Guest
Posts: n/a
 
      05-12-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >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?
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1st Drop-down selection determins selected value in all drop-downs In ASP.Net Wizard jaysch ASP .Net 0 04-30-2011 02:19 PM
Linking 2 Drop Downs and Repeater Control BryanS ASP .Net 0 03-16-2005 02:21 PM
dual drop downs =?Utf-8?B?TWlrZQ==?= ASP .Net 1 03-09-2005 08:23 PM
list of drop downs JohnZing ASP .Net 0 01-30-2005 07:09 PM
Need Script For Drop Downs Davmagic .Com Perl 0 10-14-2004 03:25 PM



Advertisments