Binding ListBox leads to control not being displayed corectly

4 posts, 1 answers
  1. Goran
    Goran avatar
    77 posts
    Member since:
    Feb 2011

    Posted 22 Feb 2012 Link to this post

    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?
  2. George
    Admin
    George avatar
    1332 posts

    Posted 23 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Goran
    Goran avatar
    77 posts
    Member since:
    Feb 2011

    Posted 23 Feb 2012 Link to this post

    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
  5. Answer
    Dani
    Admin
    Dani avatar
    848 posts

    Posted 24 Feb 2012 Link to this post

    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 >>
Back to Top