[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1269
  • Last Modified:

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

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
BYTECHINDIA
Asked:
BYTECHINDIA
2 Solutions
 
David Johnson, CD, MVPOwnerCommented:
set the default display parameter of the control to false and then set it to true when you wish to see it
0
 
BYTECHINDIAAuthor Commented:
Ok, but How to access third item of combobox in  wpf?
0
 
apeterCommented:
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

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now