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

Listbox row highlights

1 Answer 82 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
GEB
Top achievements
Rank 1
GEB asked on 26 Dec 2008, 04:17 PM
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.

1 Answer, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 29 Dec 2008, 01:25 PM
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?

Regards,
Miroslav
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
DragAndDrop
Asked by
GEB
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or