corelibraries-devexpress-dot-data-228b6d7e.md
A data source used to supply and obtain a typed list of objects to data-aware controls in unbound mode.
Namespace : DevExpress.Data
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
[ToolboxBitmap(typeof(ResFinder), "Bitmaps256.UnboundDataSource.bmp")]
public class UnboundSource :
Component,
IListSource,
ISupportInitialize
<ToolboxBitmap(GetType(ResFinder), "Bitmaps256.UnboundDataSource.bmp")>
Public Class UnboundSource
Inherits Component
Implements IListSource,
ISupportInitialize
To use the UnboundSource component, drag it to the form from the DX.25.2: Data & Analytics tab of the Visual Studio Toolbox. You can also add and configure an UnboundSource with the Data Source Configuration Wizard.
To setup the UnboundSource ‘s list and its columns, use the UnboundSource.Properties property.
Handle the UnboundSource.ValueNeeded and UnboundSource.ValuePushed events to obtain data from your data storage and save modified data back.
unboundSource1.ValueNeeded+= unboundSource1_ValueNeeded;
unboundSource1.ValuePushed+= unboundSource1_ValuePushed;
//...
void unboundSource1_ValueNeeded(object sender, DevExpress.Data.UnboundSourceValueNeededEventArgs e) {
e.Value = something; /* Assign the real data here.*/
}
void unboundSource1_ValuePushed(object sender, DevExpress.Data.UnboundSourceValuePushedEventArgs e) {
something = e.Value; /* Propagate the value into the storage.*/
}
AddHandler unboundSource1.ValueNeeded, AddressOf unboundSource1_ValueNeeded
AddHandler unboundSource1.ValuePushed, AddressOf unboundSource1_ValuePushed
'...
Private Sub unboundSource1_ValueNeeded(ByVal sender As Object, ByVal e As DevExpress.Data.UnboundSourceValueNeededEventArgs)
e.Value = something ' Assign the real data here.
End Sub
Private Sub unboundSource1_ValuePushed(ByVal sender As Object, ByVal e As DevExpress.Data.UnboundSourceValuePushedEventArgs)
something = e.Value ' Propagate the value into the storage.
End Sub
Use the UnboundSource methods (UnboundSource.Add, UnboundSource.Move, UnboundSource.InsertAt, UnboundSource.RemoveAt, etc.) to notify the bound control that the data is changed.
Object MarshalByRefObject Component UnboundSource
See Also