corelibraries-devexpress-dot-data-dot-linq-dot-entityinstantfeedbacksource-e9bb1bab.md
Occurs when the EntityInstantFeedbackSource no longer needs the queryable source it used to retrieve objects from the data store.
Namespace : DevExpress.Data.Linq
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
public event EventHandler<GetQueryableEventArgs> DismissQueryable
Public Event DismissQueryable As EventHandler(Of GetQueryableEventArgs)
The DismissQueryable event's data class is GetQueryableEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| AreSourceRowsThreadSafe | Specifies whether elements retrieved by the LinqInstantFeedbackSource‘s queryable source are thread-safe. |
| KeyExpression | Gets or sets the name of the key property. |
| QueryableSource | Gets or sets the queryable data source. |
| Tag | Gets or sets an arbitrary object associated with a queryable source. |
You can access the object you have assigned to the GetQueryableEventArgs.Tag property in the EntityInstantFeedbackSource.GetQueryable event handler.
public partial class Form1 : Form {
private void Form1_Load(object sender, EventArgs e) {
efInstantFeedbackSource1.KeyExpression = "EmployeeID";
efInstantFeedbackSource1.GetQueryable += efInstantFeedbackSource1_GetQueryable;
efInstantFeedbackSource1.DismissQueryable += efInstantFeedbackSource1_DismissQueryable;
gridControl1.DataSource = efInstantFeedbackSource1;
}
void efInstantFeedbackSource1_GetQueryable(object sender, GetQueryableEventArgs e) {
NorthwindEntities objectContext = new NorthwindEntities();
e.QueryableSource = objectContext.Employees;
e.Tag = objectContext;
}
void efInstantFeedbackSource1_DismissQueryable(object sender, GetQueryableEventArgs e) {
((NorthwindEntities)e.Tag).Dispose();
}
}
Partial Public Class Form1
Inherits Form
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
efInstantFeedbackSource1.KeyExpression = "EmployeeID"
AddHandler efInstantFeedbackSource1.GetQueryable, AddressOf efInstantFeedbackSource1_GetQueryable
AddHandler efInstantFeedbackSource1.DismissQueryable, AddressOf efInstantFeedbackSource1_DismissQueryable
gridControl1.DataSource = efInstantFeedbackSource1
End Sub
Private Sub efInstantFeedbackSource1_GetQueryable(ByVal sender As Object, ByVal e As GetQueryableEventArgs)
Dim objectContext As New NorthwindEntities()
e.QueryableSource = objectContext.Employees
e.Tag = objectContext
End Sub
Private Sub efInstantFeedbackSource1_DismissQueryable(ByVal sender As Object, ByVal e As GetQueryableEventArgs)
CType(e.Tag, NorthwindEntities).Dispose()
End Sub
End Class
See Also
EntityInstantFeedbackSource Class