DABindingList Class
From RemObjects Wiki
This is a Data Abstract for .NET Library topic
Please do not modify the page structure, but feel free to modify/add text.
Contents |
Overview
The DABindingList class represents the generic collection that supports data binding. The DABindingList class can be bound with datagrid or any other control.
For example:
var lQuery = from emp in linqRemoteDataAdapter.GetTable<Worker>() select emp; grid.DataSource = lQuery.ToDABindingList();
This code gets the resultset from the Worker class generated by Linq and binds this resultset with the grid data source.
The DABindingList class also performs automatic tracking of changes in the remote table. To apply changes on the server, the ApplyChanges method can be used.
For creating a new DABindingList instance, we recommend using the ToDABindingList extension method of the BindingListExtensions class.
An example for the usage of the DABindingList class can be found in the DA sample DA LINQ.
Location
- Assembly: RemObjects.DataAbstract.Linq.dll
- Namespace: RemObjects.DataAbstract.Linq
- System.ComponentModel.BindingList<T>
- DABindingList
Properties
| IgnoreChange protected |
|---|
|
If this property equals true, it ignores all changes with items of the current DABindingList collection, otherwise it applies them.
|
| Merging protected |
|
This property is not used at the moment, but will be in the future.
|
| ResetThreshold |
|
|
Instance Methods
| constructor (LinqRemoteDataAdapter) |
|---|
|
Creates a new DABindingList object with the specified LinqRemoteDataAdapter object. This constructor hooks the table with the type T from the LinqRemoteDataAdapter with the current DABindingList object. T is the class that represents the Linq generated class. For example:
|
| constructor (RemoteTable<T>) |
|
Creates a binding list for the given remote table aTable.
|
| ClearItems protected |
|
|
| DoEnqueueChange protected |
|
This protected method registers and tracks changes that the user made inside the binding list.
|
| FindMatchingRecord protected |
|
|
| InsertItem protected |
|
Inserts a new item into the current DABindingList list. Before insertion, it invokes the SetIdenties method, which sets the new identity for the new item. The new identity will be set only for fields of the types datAutoInc and datLargeAutoInc. If the binding remote table doesn't have autoinc fields, no identity will be set.
|
| MergeRecord |
|
|
| MergeRecords |
|
|
| MonoAddNotify protected |
|
|
| MonoRemoveNotify protected |
|
|
| NotifyAction protected |
|
Protected specific method that handles insert and delete changes within the remote table. The NotifyAction method delegates the processing of the given change to the DoEnqueueChange method, which is more common.
|
| OnListChanged |
|
Raises the ListChanged event, which occurs when the list or an item in the list changes. The DABindingList class overrides this method and adds functions that add and/or update the item in the binding remote table.
|
| RemoveItem protected |
|
Removes the item with the specified index anIndex from the binding remote table. This method is virtual, so you can override it in the descendant classes and realize the specified method, which will remove the item from the custom collection.
|
| ResetChanges |
|
Resets all changes from the current DABindingList object. This method removes all the changes from the binding remote table.
|
| SaveChanges |
|
Empty method.
|
| SetIdenties |
|
Sets a new temporary identity for the item anItem. This method is used before the insertion of a new item into the binding remote table. The first insert item will be given the temporary ID = -1, the second -2, etc. These negative IDs will be used later during the merging of the data that comes back from the server.
|
| SetItem protected |
|
|
See Also
- LINQ (Data Abstract)
- Remote Data Adapters
- Lists
- Data Abstract for .NET: Namespaces – Interfaces – Classes – Enums
- RemObjects SDK for .NET: Namespaces – Interfaces – Classes – Enums
- Data Abstract shared: Data Types – File Types
- other editions
- Data Abstract for Delphi: Interfaces – Classes – Enums
- Data Abstract for Xcode: Protocols – Classes – Enums
- Data Abstract for .NET: Namespaces – Interfaces – Classes – Enums
Product: RemObjects Data Abstract
Available Editions: Data Abstract for .NET, Delphi and Xcode
Glossary — Architecture — Articles — Features — Library — Samples