user2067120
user2067120

Reputation: 267

How to disable drag drop row from one datagridview to another?

I have imported "DataGridView" control from Windows form to WPF due to specific reason. There is customized rows in "DataGridView" like first cell is "ComboBox" with dropdown list and others cells are simple "textBoxes" with readonly mode. I have placed two customized "DataGridViews" on same Grid(plz refere snapshot).There is one problem when i select comboBox from cell one from any row of "DataGriView1" and hold any item from comboBox,and dragged onto "DataGriView2" then double entries added. Actually I don't want to allow user to drag drop items from "DataGriView1" to "DataGriView2".

Thanks in advance.enter image description here

Upvotes: 0

Views: 1460

Answers (1)

gzaxx
gzaxx

Reputation: 17600

Use AllowDrop property of DataGridView

DataGriView1.AllowDrop = false;

Upvotes: 2

Related Questions