Problem with getting List to tree view control in (wodSFTP / wodSFTP.NET / wodSFTPdll)

by computermarshal @, (7101 days ago)

I get list of files ,
sftp.ListDir( /html );
Then I try to add it to treeview control ,
treeview.Nodes.Add( dirname );
But it give me exception.

The action being performed on this control is being called from the wrong thread. You must marshal to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action.

What the hack is with the control. How to solve this.
Plz Plz Plz.. help me.

locked

Re: Problem with getting List to tree view control

by Jasmine, (7101 days ago) @ computermarshal

This problem isn't related to wodSFTP.NET at all. Error says it all - you must populate ListDir from different thread, probably main thread.

locked

Re: Problem with getting List to tree view control

by computermarshal @, (7101 days ago) @ Jasmine

This problem isn't related to wodSFTP.NET at all. Error says it all - you must populate ListDir from different thread, probably main thread.


So how to to this. because I want it to be in

private void sftp_ListItemsEvent(object Sender, SFTP.ListItemsArgs Args)

locked

Re: Problem with getting List to tree view control

by Jasmine, (7101 days ago) @ computermarshal

Well, obviously it cannot. This isn't wodSFTP's limitation, this is TreeView's limitation.

So, you could store it to some collection, and then populate it from main thread using that collection.

locked