Solved

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

Posted on 2014-09-24
3
1,015 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

14 Experts available now in Live!

Get 1:1 Help Now