PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Customizing ComboBox

Reply

Customizing ComboBox

 
Thread Tools Rate Thread
Old 09-01-2007, 03:57 PM   #1
Jose Fernandez
Guest
 
Posts: n/a
Default Customizing ComboBox


Hey...
How are you doing?

Ok, New Year's troubles...

I am trying to create a custom ComboBox (inheriting from ComboBox object).

Well, my whole goal is simple. I want to add some Properties, so, in Design
Time, i specify from wich entity i am gonna populate my Dropdown (using
Reflection and invoking a method to retrieve an arraylist with the values).

But, i have to admit i am getting lost on my way to achieve it.

I haven't been able to find a good article in google. I came to this forum.
I need help

thanks in advance
Jose


  Reply With Quote
Old 09-01-2007, 04:15 PM   #2
Stoitcho Goutsev \(100\)
Guest
 
Posts: n/a
Default Re: Customizing ComboBox

Jose,

You didn't give enough information in order to give you more concreted
advice, but can't you just use standard databinding for that?


--
Stoitcho Goutsev (100)
"Jose Fernandez" <ppcuban@hotmail.com> wrote in message
news:uTRNwbANHHA.3588@TK2MSFTNGP06.phx.gbl...
> Hey...
> How are you doing?
>
> Ok, New Year's troubles...
>
> I am trying to create a custom ComboBox (inheriting from ComboBox object).
>
> Well, my whole goal is simple. I want to add some Properties, so, in
> Design Time, i specify from wich entity i am gonna populate my Dropdown
> (using Reflection and invoking a method to retrieve an arraylist with the
> values).
>
> But, i have to admit i am getting lost on my way to achieve it.
>
> I haven't been able to find a good article in google. I came to this
> forum.
> I need help
>
> thanks in advance
> Jose
>



  Reply With Quote
Old 09-01-2007, 04:32 PM   #3
Jose Fernandez
Guest
 
Posts: n/a
Default Re: Customizing ComboBox

OK.

what i want is that when i drag the CustomcomboBox to the form, then i
specify in the properties windows the name of the Entity (custom Object...
Employee for example).
So, using reflection, i invoke the Employee object, and then its methods
LoadCombo. This method returns an arraylist with the ID and FullName of the
Employee.

Ok, I want to create one and only customComboBox for this. Cause every
entity is going to have a LoadCombo method that will populate a Combo (by
returning an arraylist). So, very easy would be just to drag the
customcombobox to the form, write in the property window the entity name and
voila, when press F5 you should see the combo populated with the values.



"Stoitcho Goutsev (100)" <100@100.com> wrote in message
news:exqf0lANHHA.2028@TK2MSFTNGP03.phx.gbl...
> Jose,
>
> You didn't give enough information in order to give you more concreted
> advice, but can't you just use standard databinding for that?
>
>
> --
> Stoitcho Goutsev (100)
> "Jose Fernandez" <ppcuban@hotmail.com> wrote in message
> news:uTRNwbANHHA.3588@TK2MSFTNGP06.phx.gbl...
>> Hey...
>> How are you doing?
>>
>> Ok, New Year's troubles...
>>
>> I am trying to create a custom ComboBox (inheriting from ComboBox
>> object).
>>
>> Well, my whole goal is simple. I want to add some Properties, so, in
>> Design Time, i specify from wich entity i am gonna populate my Dropdown
>> (using Reflection and invoking a method to retrieve an arraylist with the
>> values).
>>
>> But, i have to admit i am getting lost on my way to achieve it.
>>
>> I haven't been able to find a good article in google. I came to this
>> forum.
>> I need help
>>
>> thanks in advance
>> Jose
>>

>
>



  Reply With Quote
Old 09-01-2007, 07:19 PM   #4
Kevin Spencer
Guest
 
Posts: n/a
Default Re: Customizing ComboBox

As long as every object that is associated with a ComboBox has a property
that can be DataBound to the ComboBox, you shouldn't need to do this at all.
Just use normal DataBinding.

--
HTH,

Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com

Where there's a Will, there's a William.

"Jose Fernandez" <ppcuban@hotmail.com> wrote in message
news:%23%23g%231uANHHA.1912@TK2MSFTNGP02.phx.gbl...
> OK.
>
> what i want is that when i drag the CustomcomboBox to the form, then i
> specify in the properties windows the name of the Entity (custom Object...
> Employee for example).
> So, using reflection, i invoke the Employee object, and then its methods
> LoadCombo. This method returns an arraylist with the ID and FullName of
> the Employee.
>
> Ok, I want to create one and only customComboBox for this. Cause every
> entity is going to have a LoadCombo method that will populate a Combo (by
> returning an arraylist). So, very easy would be just to drag the
> customcombobox to the form, write in the property window the entity name
> and voila, when press F5 you should see the combo populated with the
> values.
>
>
>
> "Stoitcho Goutsev (100)" <100@100.com> wrote in message
> news:exqf0lANHHA.2028@TK2MSFTNGP03.phx.gbl...
>> Jose,
>>
>> You didn't give enough information in order to give you more concreted
>> advice, but can't you just use standard databinding for that?
>>
>>
>> --
>> Stoitcho Goutsev (100)
>> "Jose Fernandez" <ppcuban@hotmail.com> wrote in message
>> news:uTRNwbANHHA.3588@TK2MSFTNGP06.phx.gbl...
>>> Hey...
>>> How are you doing?
>>>
>>> Ok, New Year's troubles...
>>>
>>> I am trying to create a custom ComboBox (inheriting from ComboBox
>>> object).
>>>
>>> Well, my whole goal is simple. I want to add some Properties, so, in
>>> Design Time, i specify from wich entity i am gonna populate my Dropdown
>>> (using Reflection and invoking a method to retrieve an arraylist with
>>> the values).
>>>
>>> But, i have to admit i am getting lost on my way to achieve it.
>>>
>>> I haven't been able to find a good article in google. I came to this
>>> forum.
>>> I need help
>>>
>>> thanks in advance
>>> Jose
>>>

>>
>>

>
>



  Reply With Quote
Old 10-01-2007, 03:16 PM   #5
Stoitcho Goutsev \(100\)
Guest
 
Posts: n/a
Default Re: Customizing ComboBox

I agree with Kevin. Take a look at the databinding feature. At the very this
is what databinding is all about.


--
Stoitcho Goutsev (100)

"Kevin Spencer" <unclechutney@nothinks.com> wrote in message
news:utoFVMCNHHA.4000@TK2MSFTNGP06.phx.gbl...
> As long as every object that is associated with a ComboBox has a property
> that can be DataBound to the ComboBox, you shouldn't need to do this at
> all. Just use normal DataBinding.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> Bit Player
> http://unclechutney.blogspot.com
>
> Where there's a Will, there's a William.
>
> "Jose Fernandez" <ppcuban@hotmail.com> wrote in message
> news:%23%23g%231uANHHA.1912@TK2MSFTNGP02.phx.gbl...
>> OK.
>>
>> what i want is that when i drag the CustomcomboBox to the form, then i
>> specify in the properties windows the name of the Entity (custom
>> Object... Employee for example).
>> So, using reflection, i invoke the Employee object, and then its methods
>> LoadCombo. This method returns an arraylist with the ID and FullName of
>> the Employee.
>>
>> Ok, I want to create one and only customComboBox for this. Cause every
>> entity is going to have a LoadCombo method that will populate a Combo (by
>> returning an arraylist). So, very easy would be just to drag the
>> customcombobox to the form, write in the property window the entity name
>> and voila, when press F5 you should see the combo populated with the
>> values.
>>
>>
>>
>> "Stoitcho Goutsev (100)" <100@100.com> wrote in message
>> news:exqf0lANHHA.2028@TK2MSFTNGP03.phx.gbl...
>>> Jose,
>>>
>>> You didn't give enough information in order to give you more concreted
>>> advice, but can't you just use standard databinding for that?
>>>
>>>
>>> --
>>> Stoitcho Goutsev (100)
>>> "Jose Fernandez" <ppcuban@hotmail.com> wrote in message
>>> news:uTRNwbANHHA.3588@TK2MSFTNGP06.phx.gbl...
>>>> Hey...
>>>> How are you doing?
>>>>
>>>> Ok, New Year's troubles...
>>>>
>>>> I am trying to create a custom ComboBox (inheriting from ComboBox
>>>> object).
>>>>
>>>> Well, my whole goal is simple. I want to add some Properties, so, in
>>>> Design Time, i specify from wich entity i am gonna populate my Dropdown
>>>> (using Reflection and invoking a method to retrieve an arraylist with
>>>> the values).
>>>>
>>>> But, i have to admit i am getting lost on my way to achieve it.
>>>>
>>>> I haven't been able to find a good article in google. I came to this
>>>> forum.
>>>> I need help
>>>>
>>>> thanks in advance
>>>> Jose
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off