Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2007

Tip: Looking for answers? Try searching our database.

Customizing ComboBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jose Fernandez - 09 Jan 2007 15:57 GMT
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
Stoitcho Goutsev (100) - 09 Jan 2007 16:15 GMT
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?

Signature

Stoitcho Goutsev (100)

> Hey...
> How are you doing?
[quoted text clipped - 16 lines]
> thanks in advance
> Jose
Jose Fernandez - 09 Jan 2007 16:32 GMT
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.

> Jose,
>
[quoted text clipped - 22 lines]
>> thanks in advance
>> Jose
Kevin Spencer - 09 Jan 2007 19:19 GMT
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.

Signature

HTH,

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

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

> OK.
>
[quoted text clipped - 38 lines]
>>> thanks in advance
>>> Jose
Stoitcho Goutsev (100) - 10 Jan 2007 15:16 GMT
I agree with Kevin. Take a look at the databinding feature. At the very this
is what databinding is all about.

Signature

Stoitcho Goutsev (100)

> 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
[quoted text clipped - 42 lines]
>>>> thanks in advance
>>>> Jose

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.