Back to Devexpress

WcfInstantFeedbackSource.GetSource Event

corelibraries-devexpress-dot-data-dot-wcflinq-dot-wcfinstantfeedbacksource.md

latest3.9 KB
Original Source

WcfInstantFeedbackSource.GetSource Event

Occurs when the WcfInstantFeedbackSource needs a queryable source, to retrieve objects from the WCF data service.

Namespace : DevExpress.Data.WcfLinq

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public event EventHandler<GetSourceEventArgs> GetSource
vb
Public Event GetSource As EventHandler(Of GetSourceEventArgs)

Event Data

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

PropertyDescription
AreSourceRowsThreadSafeSpecifies whether elements retrieved by the WcfInstantFeedbackSource‘s queryable source are thread-safe.
ExtenderThis property is intended for internal use.
KeyExpressionGets or sets the name of the key property.
QuerySpecifies the query request to the WCF data service.
TagGets or sets an arbitrary object associated with a queryable source.

Remarks

Handle this event, to supply a queryable source connected to the required WCF data service. The GetSourceEventArgs class exposes the GetSourceEventArgs.Tag property, which you can use to specify an arbitrary object. This object will be passed along with the GetSourceEventArgs.Query property to the WcfInstantFeedbackSource.DismissSource event handler.

csharp
public partial class Form1 : Form {
    private void Form1_Load(object sender, EventArgs e) {
        wcfInstantFeedbackSource1.KeyExpression = "CustomerID";
        wcfInstantFeedbackSource1.GetQueryable += wcfInstantFeedbackSource1_GetSource;
        gridControl1.DataSource = wcfInstantFeedbackSource1;
    }
    void wcfInstantFeedbackSource1_GetSource(object sender, GetSourceEventArgs e) {
        // DataServiceContext myDataServiceContext = ...
        e.Query = myDataServiceContext.Customers;
    }
}
vb
Partial Public Class Form1
    Inherits Form
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        wcfInstantFeedbackSource1.KeyExpression = "CustomerID"
        AddHandler wcfInstantFeedbackSource1.GetQueryable, AddressOf wcfInstantFeedbackSource1_GetSource
        gridControl1.DataSource = wcfInstantFeedbackSource1
    End Sub
    Private Sub wcfInstantFeedbackSource1_GetSource(ByVal sender As Object, ByVal e As GetSourceEventArgs)
        ' DataServiceContext myDataServiceContext = ...
        e.Query = myDataServiceContext.Customers
    End Sub
End Class

See Also

WcfInstantFeedbackSource Class

WcfInstantFeedbackSource Members

DevExpress.Data.WcfLinq Namespace