Listbox row highlights

2 posts, 0 answers
  1. GEB
    GEB avatar
    228 posts
    Member since:
    Dec 2008

    Posted 26 Dec 2008 Link to this post

    I have developed a simple example, similar to the 'First Look' sample.  I am dragging from one ListBox to another, but when the row is dropped, I'm intentionally not deleting from the first ListBox.  It all works great, except for the following two behaviors:

    1. When the user selects a row in the 'drag' ListBox, it doesn't always drag.  The user sometimes has to click on the row again to get it to drag.  I believe that I have noticed this same behavior in the 'First Look' example.

    2. When the row is dropped in the 'drop' ListBox, the highlighting for the selected row in the originating ListBox keeps it's light blue background.  When a second row is selected to drag, now both rows are highlighted.  What I want to happen is to have the original row that was dragged to 'unhighlight' when the second row is selected to drag.  If you keep dragging selections over to the 'drop' ListBox, eventually, every row in the 'drag' ListBox becomes highlighted in light blue.

    Also, any idea how to change the 'row selected' color in the ListBox.  In my example, there are two colors exhibited, light blue and and a darker blue.  I want to be able to change these colors in my XAML or code-behind code.

  2. Miroslav
    Miroslav avatar
    922 posts

    Posted 29 Dec 2008 Link to this post

    Hello Gary,

    Thanks for the feedback!

    For your first question: Yes, I have noticed this with smaller (in size) items. I will look into the problem but currently it is an open issue.

    The highlight of the ListBoxItem remains because during DragDrop the mouse is captured and it never notifies the item that it is not in it. The ListBox item has a IsMouseOver property, but it is internal.

    What you can do is set the Visual State of the ListBoxItem manually when the DragDrop is complete:

    VisualStateManager.GoToState(listBoxItem, "Normal"false); 

    Does that work for you?

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top