Jump to content

Search the Community

Showing results for tags 'listview livebinding'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. I built a multi-device app using FireMonkey. I have a ListView Live-Binding to a DB. Both synched by *. It all works normally until I left wipe an item to delete. The item can be deleted, but the DB record is not. So following Doug Rudd advice, implemented following code to store DBID and locate the deleting Item. procedure TPassPlus.LinkListControlToField1FilledListItem(Sender: TObject; const AEditor: IBindListEditorItem); begin (AEditor.CurrentObject as TListItem).Tag := DB_Table.FieldByName('DBID').AsInteger; end; myDBID:= ListView1.Selected.Tag.ToString; if DB_Table.Locate('DBID',myDBID,[]) then DB_Table.delete; It worked well to delete the DB record. However, when ListView1DeletingItem event finished, it generated a 'Argument out of range' error, which can be traced into TPresentedListView.DoDeleteItem event. It looks like, when DB record deleted, Listview has deleted the correspoding item, so when ListView1DeletingItem event finished, ListView has nothing to delete. What is the solution? I was trying to decouple the link between the DB and Listview at runtime so I can delete the record and re-link the two. I tried following code as a test. procedure TPassPlus.ListView1DeletingItem(Sender: TObject; AIndex: Integer; var ACanDelete: Boolean); begin ListView1.BeginUpdate; BindSourceDB1.DataSource.DataSet.close; //or LinkListControlToField1.Active:=false; ListView1.EndUpdate; end; On either case, it will produce 'Argument out of range' error. What is the way to do this simple task?
×