Quick Tip: a work around the RadListBox’s SelectedIndex issue with Telerik Q1 2013

If you are working with Telerik RadListBox for Silverlight or WPF and if you upgraded your Telerik version to the Q1 2013 , you probably noticed that there is something wrong with it.

Basically the problem is when SelectedIndex is changed , the SelectedItem property is not updated and vice versa.

A classic scenario is when you try to set a by default selection:

_myListBox.SelectedIndex = 0;

If(_myListBox.SelectedItem != null)

   {

       //Do something

   }

This is not working anymore with Telerik Q1 2013 because SElectedItem is not updated.

What you can do is instead of  _myListBox.SelectedIndex = 0;

put  _myListBox.SetValue(RadListBox.SelectedItemProperty, _myListBox.Items[0]);

 

Wala Sourire

Advertisements

About rabeb

Rabeb is a software engineer , fan of the latest .Net technologies, playing with Metro style applications for Win8 at work . In her spare time,she plays with Metro Style apps for Windows Phone.

Posted on March 15, 2013, in Silverlight and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: