Hello I am using custsom paging, sorting and filtering inside NeedDataSource event. To retrieve data, I am using Entity Framework under the covers. Is there any way i can get the FilterExpression in hte form of esql. From what it appears, radgrid only returns esql where clause when you use entitydatasource. can u configure somewhere in radgrid to return the where clause in the form of esql so i can use hte builder methods. There are several reasons why i cant use linq in this case. here is what i what i have.
internally i want to be able to apply the filter using builder methods in linq to entities instead of linq query.
db.Customers.Where(filter).OrderBy(orderby).Skip(startrow).Take(maxrows);
Please help!
private string _filterExpression;
protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
int startRowIndex = RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
int maximumRows = RadGrid1.PageSize;
string sort = RadGrid1.MasterTableView.SortExpressions.GetSortString();
_filterExpression = RadGrid1.MasterTableView.FilterExpression;
//needed to bypass RadGrid's internal filtering
RadGrid1.MasterTableView.FilterExpression = string.Empty;
if (configuration == null)
{
configuration = new SystemSetupFieldConfiguration(TagPrefixList, startRowIndex, maximumRows, sort, _filterExpression);
}
var combinedfields = configuration.GetCombinedFields();
var fieldcount = configuration.CombinedFieldsCount;
RadGrid1.VirtualItemCount = fieldcount;
RadGrid1.DataSource = combinedfields;
}
internally i want to be able to apply the filter using builder methods in linq to entities instead of linq query.
db.Customers.Where(filter).OrderBy(orderby).Skip(startrow).Take(maxrows);
Please help!