Hello Partho,
To do that you need to create a new NTreeView class which overrides OnDragEnter and OnDragOver methods similar to the following:
public class MyNTreeList : NTreeList
{
protected override void OnDragEnter(DragEventArgs drgevent)
{
base.OnDragEnter(drgevent);
if (drgevent.Data.GetDataPresent(DataFormats.FileDrop))
drgevent.Effect = DragDropEffects.Copy;
}
protected override void OnDragOver(DragEventArgs drgevent)
{
base.OnDragOver(drgevent);
if (drgevent.Data.GetDataPresent(DataFormats.FileDrop))
drgevent.Effect = DragDropEffects.Copy;
}
}
Then you should attach to DragDrop event of the new class and in the event handler you can should create a new NTreeListNode with the appropriate sub items for each dragged file:
void nTreeList1_DragDrop(object sender, DragEventArgs e)
{
string[] fileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
if (fileList == null)
return;
for (int i = 0; i < fileList.Length; i++)
{
NTreeListNode node = new NTreeListNode();
NTreeListNodeStringSubItem item = new NTreeListNodeStringSubItem(fileList[i]);
item.Column = nTreeList1.Columns[0];
node.SubItems.Add(item);
nTreeList1.Nodes.Add(node);
}
}
I hope this helps.
Best Regards,
Nevron Support Team