Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

List box selection changed issue

$
0
0

HI,


I'm using D&D events from list box to text box which is working fine but some times when you are choose item from

the list box and the item marked as with blue line nothing happen,you cannot drag the item .I have put break-point in

the following method and usally it stops there when everting is working well but sometimes the break-point

is not invoked when the blue line is marked ,what could be the reason for such behavior ?

Im using the following code.

        private void listbox_SelectionChanged(object sender, RoutedEventArgs routedEventArgs)
        {
            if (sender is ListBox)
            {
                var listBox = sender as ListBox;

                if (listBox.SelectedItem != null)
                {
                    var mySelectedItem = listBox.SelectedItem as User;

                    if (mySelectedItem != null)
                    {
                        DragDrop.DoDragDrop(listBox, mySelectedItem,
                                            DragDropEffects.Copy | DragDropEffects.Move);
                    }
                }
            }
        }


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>