This is a migrated thread and some comments may be shown as answers.

Binding ListBox leads to control not being displayed corectly

3 Answers 121 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Goran
Top achievements
Rank 1
Goran asked on 23 Feb 2012, 03:06 AM
We are evaluating your silverlight controls, and we are testing the functionality of ListBox control. Frequent task will be to bind ListBox to enum members. We have an enum converter class that returns object[] (which contains all members of enum). in XAML we are binding listbox like this:

<telerik:ListBox x:Name="CategoryListBox" ItemsSource="{Binding CurrentCategory, Converter={StaticResource enumConverter}}" />

CurrentCategory is a public property of ViewModel (which is assigned to DataContext). The result is that items are populated in listbox, but listbox cannot be used - it looks like disabled, you cannot select an item. IsEnabled property returns true. If I just remove telerik: from above line, and use standard MS ListBox, everything works fine.

Is this a bug?

3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 23 Feb 2012, 04:52 PM
Hello,


Could you please try to use our RadListBox control instead of ListBox? The second one is an old control which we might remove in our further releases, and the first one (RadListBox control) is a new one, introduced with the Q1 release.


All the best,
George
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Goran
Top achievements
Rank 1
answered on 23 Feb 2012, 08:27 PM
Yep, I say that one this morning :) Anyway, it can be seen its still in beta. When exactly do you think you will have final version for this control?

Binding to enum did not introduce any problems with RadListBox. However, a quick demo introduced UI problems. Steps to reproduce

1. Add 5 items to RadListBox
2. Select Item 3 - this item's Background color will become dark, and Foreground color will become light (Expression Dark theme)
3. Hover with mouse over item 2, then hover back over item 3, then again hover over item 2.

At this point you will see that selected item (Item 3) will still have light color for Background, but will change Foreground color from dark to light color, which makes it almost unreadable.

Another problem, which I am not sure if its related to RadListBox, is that coloring schemes are not the same for RadGridView and RadListBox (SelectedItem for example, mouse hover...). Similar, but not the same. Can you tell me if this is the problem with RadListBox, or...?

Thanks,
Goran
0
Accepted
Dani
Telerik team
answered on 24 Feb 2012, 03:48 PM
Hello Goran,

Indeed, RadListBox has such glitches and that is why its visual states will be revised.

Basically, we have two kinds of appearance for ItemsControls in Expresison Dark theme and this results in the discepancy you noticed. Some of the ItemsControls, such as RadMenu or RadComboBox use the same mouse over and selected states as in RadListBox. RadGridView and RadTreeListView, on the other hand, display slightly different states due to the different nature and purpose of the controls.

Update of the RadListBox Expression Dark theme will be available in the nearest LIB.

I hope this information will be helpful.

Regards,
Dani
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
ListBox
Asked by
Goran
Top achievements
Rank 1
Answers by
George
Telerik team
Goran
Top achievements
Rank 1
Dani
Telerik team
Share this question
or