DABindingList<T>
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.
An example for the usage of the DABindingList class can be found in the DA LINQ sample.
Location
- Reference: RemObjects.DataAbstract.dll
- Namespace: RemObjects.DataAbstract.Linq
- Ancestry: BindingList<T> | DABindingList<T>
constructor (LinqRemoteDataAdapter)
constructor(dataAdapter: LinqRemoteDataAdapter)
DABindingList<T>(LinqRemoteDataAdapter dataAdapter)
Sub New(dataAdapter As LinqRemoteDataAdapter)
Parameters:
- dataAdapter:
constructor (RemoteTable<T>)
constructor(table: RemoteTable<T>)
DABindingList<T>(RemoteTable<T> table)
Sub New(table As RemoteTable<T>)
Parameters:
- table:
CancelChanges
method CancelChanges
void CancelChanges()
Sub CancelChanges()
ClearItems protected
method ClearItems
void ClearItems()
Sub ClearItems()
EnqueueChange protected
method EnqueueChange(item: T; field: String; change: ChangeType)
void EnqueueChange(T item, String field, ChangeType change)
Sub EnqueueChange(item As T, field As String, change As ChangeType)
Parameters:
- item:
- field:
- change:
FindMatchingRecord protected
method FindMatchingRecord(item: T): Int32
Int32 FindMatchingRecord(T item)
Function FindMatchingRecord(item As T) As Int32
Parameters:
- item:
IgnoreChange protected
If this property equals true, it ignores all changes with items of the current DABindingList collection, otherwise it applies them.
property IgnoreChange: Boolean read write;
Boolean IgnoreChange { get; set; }
Property IgnoreChange() As Boolean
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.
method InsertItem(index: Int32; item: T)
void InsertItem(Int32 index, T item)
Sub InsertItem(index As Int32, item As T)
Parameters:
- index: Specified index.
- item: New item in the DABindingList collection.
MergeRecord
method MergeRecord(item: T)
void MergeRecord(T item)
Sub MergeRecord(item As T)
Parameters:
- item:
MergeRecords
method MergeRecords(items: array of T)
void MergeRecords(T[] items)
Sub MergeRecords(items As T())
Parameters:
- items:
Merging protected
This property is not used at the moment, but will be in the future.
property Merging: Boolean read write;
Boolean Merging { get; set; }
Property Merging() As Boolean
MonoAddNotify protected
method MonoAddNotify(obj: Object)
void MonoAddNotify(Object obj)
Sub MonoAddNotify(obj As Object)
Parameters:
- obj:
MonoRemoveNotify protected
method MonoRemoveNotify(obj: Object)
void MonoRemoveNotify(Object obj)
Sub MonoRemoveNotify(obj As Object)
Parameters:
- obj:
NotifyAction protected
method NotifyAction(item: T; change: ChangeType)
void NotifyAction(T item, ChangeType change)
Sub NotifyAction(item As T, change As ChangeType)
Parameters:
- item:
- change:
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.
method OnListChanged(e: ListChangedEventArgs)
void OnListChanged(ListChangedEventArgs e)
Sub OnListChanged(e As ListChangedEventArgs)
Parameters:
- e: Contains the complete information about changed items.
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.
method RemoveItem(index: Int32)
void RemoveItem(Int32 index)
Sub RemoveItem(index As Int32)
Parameters:
- index:
ResetChanges
Resets all changes from the current DABindingList object. This method removes all the changes from the binding remote table.
method ResetChanges
void ResetChanges()
Sub ResetChanges()
ResetThreshold
property ResetThreshold: Int32 read write;
Int32 ResetThreshold { get; set; }
Property ResetThreshold() As Int32
SaveChanges
method SaveChanges(dataAdapter: LinqRemoteDataAdapter)
void SaveChanges(LinqRemoteDataAdapter dataAdapter)
Sub SaveChanges(dataAdapter As LinqRemoteDataAdapter)
Parameters:
- dataAdapter:
SetIdenties
method SetIdenties(item: T)
void SetIdenties(T item)
Sub SetIdenties(item As T)
Parameters:
- item:
SetItem protected
method SetItem(index: Int32; item: T)
void SetItem(Int32 index, T item)
Sub SetItem(index As Int32, item As T)
Parameters:
- index:
- item:
IgnoreChange protected
If this property equals true, it ignores all changes with items of the current DABindingList collection, otherwise it applies them.
property IgnoreChange: Boolean read write;
Boolean IgnoreChange { get; set; }
Property IgnoreChange() As Boolean
Merging protected
This property is not used at the moment, but will be in the future.
property Merging: Boolean read write;
Boolean Merging { get; set; }
Property Merging() As Boolean
ResetThreshold
property ResetThreshold: Int32 read write;
Int32 ResetThreshold { get; set; }
Property ResetThreshold() As Int32
constructor (LinqRemoteDataAdapter)
constructor(dataAdapter: LinqRemoteDataAdapter)
DABindingList<T>(LinqRemoteDataAdapter dataAdapter)
Sub New(dataAdapter As LinqRemoteDataAdapter)
Parameters:
- dataAdapter:
constructor (RemoteTable<T>)
constructor(table: RemoteTable<T>)
DABindingList<T>(RemoteTable<T> table)
Sub New(table As RemoteTable<T>)
Parameters:
- table:
CancelChanges
method CancelChanges
void CancelChanges()
Sub CancelChanges()
ClearItems protected
method ClearItems
void ClearItems()
Sub ClearItems()
EnqueueChange protected
method EnqueueChange(item: T; field: String; change: ChangeType)
void EnqueueChange(T item, String field, ChangeType change)
Sub EnqueueChange(item As T, field As String, change As ChangeType)
Parameters:
- item:
- field:
- change:
FindMatchingRecord protected
method FindMatchingRecord(item: T): Int32
Int32 FindMatchingRecord(T item)
Function FindMatchingRecord(item As T) As Int32
Parameters:
- item:
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.
method InsertItem(index: Int32; item: T)
void InsertItem(Int32 index, T item)
Sub InsertItem(index As Int32, item As T)
Parameters:
- index: Specified index.
- item: New item in the DABindingList collection.
MergeRecord
method MergeRecord(item: T)
void MergeRecord(T item)
Sub MergeRecord(item As T)
Parameters:
- item:
MergeRecords
method MergeRecords(items: array of T)
void MergeRecords(T[] items)
Sub MergeRecords(items As T())
Parameters:
- items:
MonoAddNotify protected
method MonoAddNotify(obj: Object)
void MonoAddNotify(Object obj)
Sub MonoAddNotify(obj As Object)
Parameters:
- obj:
MonoRemoveNotify protected
method MonoRemoveNotify(obj: Object)
void MonoRemoveNotify(Object obj)
Sub MonoRemoveNotify(obj As Object)
Parameters:
- obj:
NotifyAction protected
method NotifyAction(item: T; change: ChangeType)
void NotifyAction(T item, ChangeType change)
Sub NotifyAction(item As T, change As ChangeType)
Parameters:
- item:
- change:
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.
method OnListChanged(e: ListChangedEventArgs)
void OnListChanged(ListChangedEventArgs e)
Sub OnListChanged(e As ListChangedEventArgs)
Parameters:
- e: Contains the complete information about changed items.
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.
method RemoveItem(index: Int32)
void RemoveItem(Int32 index)
Sub RemoveItem(index As Int32)
Parameters:
- index:
ResetChanges
Resets all changes from the current DABindingList object. This method removes all the changes from the binding remote table.
method ResetChanges
void ResetChanges()
Sub ResetChanges()
SaveChanges
method SaveChanges(dataAdapter: LinqRemoteDataAdapter)
void SaveChanges(LinqRemoteDataAdapter dataAdapter)
Sub SaveChanges(dataAdapter As LinqRemoteDataAdapter)
Parameters:
- dataAdapter:
SetIdenties
method SetIdenties(item: T)
void SetIdenties(T item)
Sub SetIdenties(item As T)
Parameters:
- item:
SetItem protected
method SetItem(index: Int32; item: T)
void SetItem(Int32 index, T item)
Sub SetItem(index As Int32, item As T)
Parameters:
- index:
- item: