ListBox Selection Display is not refreshed after scrolling

9 posts, 1 answers
  1. Jens
    Jens avatar
    11 posts
    Member since:
    Apr 2008

    Posted 16 Jul 2009 Link to this post

    Hi,
    My ListBox is populated with more items than fit into it, and I can thus scroll up and down.
    Now, when I select an item and then scroll until it is not displayed anymore, and then scroll back, the selected item is not shown in "selected" style anymore.
    Only when I move the mouse over the item, it is displayed in "selected" style again afterwards.

    This problem seems to be related with this one:
    http://www.telerik.com/community/forums/winforms/gridview/radgridview-row-formatting.aspx

    i.e. "Only the rows that are visible on screen have visual elements. When the grid is scrolled, the visual elements are reused for other logical elements."

    But I want my ListBox to show the selected items. The user doesn't want to play hide and seek.
    What do I need to do?
    /J
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 17 Jul 2009 Link to this post

    Hello Jens,

    This is really a weird issue. I tested the behavior in a simple application with the latest version of RadControls for WinForms and I was not able to reproduce it. Could you please try the same with the latest version of our product? I believe this will solve the issue.

    Please feel free to write me back if you have more questions.


    Kind regards,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jens
    Jens avatar
    11 posts
    Member since:
    Apr 2008

    Posted 17 Jul 2009 Link to this post

    Hi Boykov,
    I also created a new simple project: Just a list box and some items, nothing else. After I scroll down and up after selecting the first item, during which the selected item dis- and re-appeared, the orange selection color is not visible. Only after a MouseOver, the color returns to the selcted item. So here the effect is very well reproduceable.

    Hope you can help me.

    I work with Windows XP SP3, .NET 3.5 SP1 and the Q2/2009 controls

    Best regards,
    Jens
  5. Answer
    Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 20 Jul 2009 Link to this post

    Hi Jens,

    I have been able to reproduce this in a new project. I was actually testing this it in our QSF example of RadListBox when I wrote you previously. The issue seems to be related to our Theming mechanism.
    We will do our best to fix this for the coming Service Pack release scheduled for the end of the month.
    However as soon as I prepare a working .xml file with a new theme for RadListBox  I will send it to you and the problem will be fixed.
    At the moment I can suggest you a little patch which will visually make the control to appear as expected. Follow the steps:

    1. Subscribe to the ValueChanged event of the listbox control
      RadScrollLayoutPanel panel = listBox.ListBoxElement.Children[2] as RadScrollLayoutPanel;
                panel.VerticalScrollBar.ValueChanged += new EventHandler(VerticalScrollBar_ValueChanged);

    2. Refresh the Selection state of the selected listbox item
     RadListBox listBox =  (RadListBox)this.Controls[0];
               RadListBoxItem item = listBox.SelectedItem as RadListBoxItem;
               item.SetValue(RadListBoxItem.SelectedProperty, false);
               item.SetValue(RadListBoxItem.SelectedProperty, true);

    Thank you for the feedback.
    I have added telerik points to your account for this bug report.

    Best wishes,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Jens
    Jens avatar
    11 posts
    Member since:
    Apr 2008

    Posted 20 Jul 2009 Link to this post

    Excellent,
    thank you, Boyko!

    /J
  7. Gary Gorham
    Gary Gorham avatar
    2 posts
    Member since:
    Feb 2006

    Posted 30 Oct 2009 Link to this post

    Can you tell me if this has been fixed yet ?

    Thank you

    Gary
  8. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 02 Nov 2009 Link to this post

    Hello Gary Gorham,

    Thank you for the question. Please specify which theme you are using for RadListBox? I confirm that this issue is fixed but I need this information to test it (just in case). I am looking forward to your reply.

    Best wishes,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Gary Gorham
    Gary Gorham avatar
    2 posts
    Member since:
    Feb 2006

    Posted 02 Nov 2009 Link to this post

    Hi Victor -

    I am using the Telerik theme and the RadListbox control version is 2009.2.9.729. I am still having this same problem.

    Thanks for your help.

    Gary
  10. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 03 Nov 2009 Link to this post

    Hi Gary Gorham,

    Thank you for the provided information. I experienced the issue with the Telerik theme. It appears that this happens because of the virtualization mechanism. You can circumvent this issue by setting the Virtualized property of RadListBox to false. The virtualization is scheduled for re-factoring and the major improvements will be available in Q1 2010. Also please note that in a few days we will be releasing Q3 2009 release which includes a more robust data binding mechanism for RadListBox as well as overall performance and memory usage improvements. You will be able to see all the new features on our web site when we release the new version. Please write again if you have other questions.

    Sincerely yours,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for WinForms is Visual Studio 2017 Ready