I have a custom filtered pythonaddins.OpenDialog() , Is it possible to drag drop layers into TOC ?
This is possible from windows explorer and folder connection.
I am quite certain what you ask is not possible. The OpenDialog() method calls the same dialog used by the Add Data.... dialog and many more, and you cannot drag & drop from within that dialog/control to the TOC.
Thank you for the reply. In that case what is the advantage of using pythonaddins.OpenDialog()? we can create a python adding which calls the explorer window as a sub process and search and drag layers from that to TOC. which is better method ?
Which is better depends on your situation. Calling OpenDialog() gets you a dialog that looks and functions like other dialogs users are used to in ArcGIS, and it is simple to code. If dragging from the dialog to the TOC is important, and you are comfortable working with calling subprocesses, it seems that would be what is best in your situation.
Thank you again, Personally I like the ESRI Add data like dialog, but our requirement is to let users search for layers from 100s of layers from different sub folders and add to TOC. We can call "explorer.exe" using subprocess.popen with couple of lines of code. But I am not sure if there is any other issue with this, so far it works fine.