Solved

enable and disable control.combobox items dynamically in a wpf usercontrol

Posted on 2014-09-24
3
987 Views
Last Modified: 2014-09-28
Hello All

I have a combo box in a wpf usercontrol.I have to dynamically means by using code,enable and diable its items on load event of usercontrol.Please help.
I have already tried ItemContainerGenerator.ContainerFromIndex() and  ItemContainerGenerator.ContainerFromItem(),both are returning NULL.
Only in selection changed event they retrieves the data but I want it on load or constructor call of user control.
Is it possible?
Thanks in advance.
0
Comment
Question by:BYTECHINDIA
3 Comments
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 250 total points
Comment Utility
set the default display parameter of the control to false and then set it to true when you wish to see it
0
 

Author Comment

by:BYTECHINDIA
Comment Utility
Ok, but How to access third item of combobox in  wpf?
0
 
LVL 25

Assisted Solution

by:apeter
apeter earned 250 total points
Comment Utility
Until the user control is loaded, you can't access combo box. Once the  user control is loaded, in that event based your business logic you can enable or disable the combo box control.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Email Body 4 46
How do I get the id from URL? 19 46
Duplicate a row 2 29
Library to convert HTML to PDF. 8 44
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now