Skip to main content

Microsoft Silverlight

Answered Question ComboBox selection change using C#RSS Feed

(0)

Peter from SFW
Peter fr...

Member

Member

164 points

51 Posts

ComboBox selection change using C#

Last week a managed to make a ScrollViewer and a TreeView to scroll up/down through clicking unrelated buttons or scrolling the mouse wheel by using AutomationPeers.

 I tried to move the items of a ComboBox box up/down without opening the popup below through C#, but it does not work. I noticed that when the ComboBox is focused you can move the items up/down by using the arrow keys on the keyboard, so there has to be a way to do what I am trying to do.

Is there anyone who has done that already?

Peter from SFW
www.sfwllc.com

Keith.Mahoney
Keith.Ma...

Participant

Participant

872 points

131 Posts

Microsoft
Answered Question

Re: ComboBox selection change using C#

 Did you try changing the SelectedIndex propery on the ComboBox control?

Keith Mahoney
Silverlight SDET
Microsoft

Peter from SFW
Peter fr...

Member

Member

164 points

51 Posts

Re: ComboBox selection change using C#

Thank you for suggesting to modify the 'SelectedIndex'.

It does force the control to show next selected index...

Peter from SFW
www.sfwllc.com

Keith.Mahoney
Keith.Ma...

Participant

Participant

872 points

131 Posts

Microsoft

Re: ComboBox selection change using C#

That does not sound right; the ComboBox visuals should update if you change the SelectedIndex. If it is possible, it would be great to take a look at some code/xaml that exhibited this behaviour so I could determine if there is a bug in the platform.

Keith Mahoney
Silverlight SDET
Microsoft

Peter from SFW
Peter fr...

Member

Member

164 points

51 Posts

Re: ComboBox selection change using C#

You are right, I had to edit my Post after I figured it out... I guess when I saw the problem, I was not paying enough attension...

 Thank, again...

Peter from SFW
www.sfwllc.com
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities