How to Prevent SelectionChange a Silverlight DataGrid

Posted by Matt Eland on Stack Overflow See other posts from Stack Overflow or by Matt Eland
Published on 2010-05-18T20:47:40Z Indexed on 2010/05/18 20:50 UTC
Read the original article Hit count: 681

I'm using a Silverlight 3 DataGrid control and have set the SelectionMode to Extended. The DataGrid takes care of managing the extended selection for me in an almost perfect manner out of the box, but a key piece of the logic is interfering with me.

I have a cell that can function as a drag and drop thumb and initiate a drag operation but users want to do a series of shift or control clicks to set a selection followed by a click and drag on one of the selected rows to initiate the drag.

The problem is that the click and drag at the end of this series causes the selection to be set to only the row that was clicked. I've poked around for ways of conditionally preventing the DataGrid from changing selection, but can't seem to find anything that works.

Does anyone have any ideas for preventing selection from changing?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about datagrid