Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-09-24
3
Medium Priority
?
1,151 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 83

Accepted Solution

by:
David Johnson, CD, MVP earned 750 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 750 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

705 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