Click here to Skip to main content
15,867,867 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do i Add items in a combobox which is in a usercontrol...
I need to add item in the Designing mode of that userControls..?

plz help... need urgentally...
Posted
Updated 18-May-11 1:33am
v4
Comments
Sandeep Mewara 18-May-11 7:28am    
Not clear.
Sergey Alexandrovich Kryukov 18-May-11 12:17pm    
It's clear enough to give the answer, but OP should tag UI library.
Please see my solution.
--SA
Sandeep Mewara 18-May-11 12:19pm    
After few revisions, I guess. :)

But still a little unclear to me! :doh:
Sergey Alexandrovich Kryukov 18-May-11 17:46pm    
My answer works in all cases, as it's trivial thing.
--SA
Sergey Alexandrovich Kryukov 18-May-11 12:17pm    
Always tag it? WPF, Forms or what?!
--SA

1 solution

Bad idea. You should add items from data, not "hard-code" them through Designer. I have to try it — such a bad idea never visited my head…

OK, there is a usual small error button on right top edge if the control shown in Designer, click it — it will pop-up "ComboBox Tasks" with "Edit items" — click it and edit your items.

Problem solved.

But… don't do it! You should always populate or data-bind your controls based on data, even if your items are constants. What you're trying to do is not maintainable at all. Use Designed only for layouts, nothing else.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900