Problem with getting List to tree view control in (wodSFTP / wodSFTP.NET / wodSFTPdll)
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.
Re: Problem with getting List to tree view control
This problem isn't related to wodSFTP.NET at all. Error says it all - you must populate ListDir from different thread, probably main thread.
Re: Problem with getting List to tree view control
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)
Re: Problem with getting List to tree view control
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.