Solved

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

Posted on 2014-09-24
3
1,088 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 81

Accepted Solution

by:
David Johnson, CD, MVP earned 250 total points
ID: 40342955
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
ID: 40343250
Ok, but How to access third item of combobox in  wpf?
0
 
LVL 25

Assisted Solution

by:apeter
apeter earned 250 total points
ID: 40344639
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ado.net AddWithValue when using IN condition 7 45
LINQ Select all records by MAX data syntax help 1 51
C# Get Current Exchange Rate from XE 9 42
Put File 6 37
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

751 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