Back to Devexpress

UnboundDataSource.ValueNeeded Event

wpf-devexpress-dot-xpf-dot-core-dot-datasources-dot-unbounddatasource-6229f796.md

latest4.2 KB
Original Source

UnboundDataSource.ValueNeeded Event

Occurs before a value is pulled from the data source.

Namespace : DevExpress.Xpf.Core.DataSources

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public event EventHandler<UnboundSourceValueNeededEventArgs> ValueNeeded
vb
Public Event ValueNeeded As EventHandler(Of UnboundSourceValueNeededEventArgs)

Event Data

The ValueNeeded event's data class is UnboundSourceValueNeededEventArgs. The following properties provide information specific to this event:

PropertyDescription
PropertyIndex
PropertyNameGets the name of the property whose value is requested.
RowIndexGets the row index of the value.
TagGets an object that contains data associated with the value.
ValueSpecifies the value which is requested.

The event data class exposes the following methods:

Method
SetValue<T>(T)

Remarks

Handle the ValueNeeded event to pull a value from the data source.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ValueNeeded event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

use-unbounddatasource-to-populate-wpf-data-grid-with-data/CS/UnboundSource/MainWindow.xaml#L20

xml
Count="5"
ValueNeeded="UnboundDataSource_ValueNeeded"
ValuePushed="UnboundDataSource_ValuePushed">

use-unbounddatasource-to-populate-wpf-data-grid-with-data/CS/UnboundSource/obj/Debug/net8.0-windows/MainWindow.g.cs#L97

csharp
#line 20 "..\..\..\MainWindow.xaml"
this.unboundDataSource1.ValueNeeded += new System.EventHandler<DevExpress.Data.UnboundSourceValueNeededEventArgs>(this.UnboundDataSource_ValueNeeded);

use-unbounddatasource-to-populate-wpf-data-grid-with-data/VB/UnboundSource/obj.NetFX/Debug/MainWindow.g.vb#L96

vb
#ExternalSource("..\..\MainWindow.xaml",20)
AddHandler Me.unboundDataSource1.ValueNeeded, New System.EventHandler(Of DevExpress.Data.UnboundSourceValueNeededEventArgs)(AddressOf Me.UnboundDataSource_ValueNeeded)

See Also

UnboundDataSource Class

UnboundDataSource Members

DevExpress.Xpf.Core.DataSources Namespace