Using RIA Services FilterDescriptor from code behind
Posted
by Fermin
on Stack Overflow
See other posts from Stack Overflow
or by Fermin
Published on 2010-06-08T11:00:02Z
Indexed on
2010/06/08
11:02 UTC
Read the original article
Hit count: 837
silverlight-4.0
|ria-services
Hi,
I was wondering if it's possible to use the FilterDescriptor control from code behind?
On the page load of my form I set the datasource of a grid in the code behind, not using a DomainDataSource control, like:
TestDomainContext context = new TestDomainContext();
dataGridEmployees.ItemsSource = context.EmployeePositions;
context.Load(context.GetEmployeesWithPositionQuery());
I have a textbox on my page that the user can enter into to filter on employee position.
Is it now possible to add FilterDescriptor to the source of the DataGrid in code behind? Or would I manually need to filter the results of the context.GetEmployeesWithPositionQuery, for example on KeyUp event of the filter TextBox?
© Stack Overflow or respective owner