vis781-I have tried with all tips mentioned in other thread.When a DataGridViewControl is not bound to DataRowView is empty and there is no source available to copy/move on to target.What's the best way to handle this scenario?Appreciate an immediate response
John-I don't get your tip.Can you send me a working sample with DataGridView control populated with hard coded values in container form and not bound to data source?
The DataGridView has got a Rows property. This Rows property is a collection of DataGridViewRow objects. Each DataGridViewRow object has got a Cells property. This Cells property is a collection of DataGridViewCell objects. The DataGridViewCell has got the Value property for instance. All this is well described with examples in documentation. Also using the code editor with intellisense that always tells you all members of objects and give description of each is good help for programmer in search of knowledge. Example:
VB.NET:
Dim r As DataGridViewRow = DataGridView1.Rows(0)
For Each c As DataGridViewCell In r.Cells
MsgBox(c.Value)
Next
You would probably send the DataGridViewRow object for dragdrop operation and do something with the values you want to put in TreeView node(s). See the drag and drop windows forms topic in documentation, it is always the same procedure when you do drag and drop in windows forms, the only difference is what object you send and which values to handle on drop. You choose yourself what data you want to send, and you choose how it will be dropped. Online this page is: "Walkthrough: Performing a Drag-and-Drop Operation in Windows Forms" http://msdn2.microsoft.com/en-us/library/za0zx9y0.aspx
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.