Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Upload the FillTreeView

 Post Reply Post Reply
Author
Powell Graham View Drop Down
Member
Member
Avatar

Joined: 04 Jan 2013
Posts: 85
Post Options Post Options   Quote Powell Graham Quote  Post ReplyReply Direct Link To This Post Topic: Upload the FillTreeView
    Posted: 09 Jul 2015 at 5:19pm
Running on Android with XE8.

My application is based on the FireMonkey Cloud Storage Demo.

Basically the cod looks like this:

    fn := TPath.Combine(SharedCardPath, f_str);

    if Assigned(TreeView1.Selected) then
    begin
      ci := TTMSFMXCloudItem(TTMSFMXCloudTreeViewItem(TreeView1.Selected).DataObject);
      nci := Storage.Upload(ci, fn);

      if Assigned(nci) then
      begin
        Storage.FillTreeView(TreeView1);
      end;
    end;

The Upload works correctly and returns an Assigned value for nci.
The call to FillTreeView fails with an "Argument out of range" error.
This happens if I upload a new file or overwrite an existing one.

Any clues?

Graham
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3339
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jul 2015 at 8:54am
Hi,

Are you sure the DataObject contains a value?
Can you perhaps try to clear the Treeview before filling it with data?

Kind Regards, 
Pieter
Back to Top
Powell Graham View Drop Down
Member
Member
Avatar

Joined: 04 Jan 2013
Posts: 85
Post Options Post Options   Quote Powell Graham Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jul 2015 at 11:12am
Clearing the TreeView first seems to solve the problem. And the call to GetDriveInfo also seems to improve the TreeView display.

      if Assigned(nci) then
      begin
        TreeView1.Clear;
        MyStorage.GetDriveInfo;
        MyStorage.FillTreeView(TreeView1);
      end;

I have another observation now that I will start in a new post.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down