I have a Windows Forms application. One of the forms has a grid on it, in which I hope to display a list of filenames and descriptions (i.e. two columns of string data). I would like to allow the user to have the form open as well as a window for File/Windows Explorer, giving them the ability to select one or more files in the latter, and drag them to the grid. Then, when this happens, I would like to interrogate the dropped items to pull the file path and name. Is this possible to do using the grid control? If not, could it be done if I had another form in my application that basically functioned like File/Windows Explorer, thereby allowing the user to click and drag from one form to the grid on the other? Last, but not least, if neither of those options is possible, could I have another control on the same form with the grid (i.e. perhaps another grid or a treeview or something), and allow the user to drag and drop from that control to the grid?
Add ability to drag and drop files from File/Windows Explorer to Grid control in Windows Form application
Answers approved by DevExpress Support
Hi Bob,
This task is not directly related to XtraGrid and can be implemented manually. It is necessary to set the gridControl's AllowDrop property to true. Then, handle the gridControl's Drag~ events to determine which data is dragged to the grid and manage it as necessary. Please also refer to the How do I drag and drop files into a c# application? SO question.