Hello all, I can't seem to get lowercase filtering to work. I have a client table with last names as such 'Jones', 'Adams' ect
Filtering on that column in lowercase such as typing in 'jones' and using contains will not show in the grid even if I step through and see that I am returning a row of data. Typing in 'Jones' and filtering that way works fine. I think i am doing something wrong with my NeedDataSource event.
Here is my code ( i am using Custom paging):
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
int count = 0;
RadGrid1.DataSource = ClientBLL.GetPagedClients(RadGrid1.PageSize, RadGrid1.MasterTableView.CurrentPageIndex * RadGrid1.PageSize, RadGrid1.MasterTableView.FilterExpression, currentsort.Value, out count);
RadGrid1.MasterTableView.VirtualItemCount = count;
}
Here is the code for retrieving the data:
public static IQueryable<APAPortal.vw_client> GetPagedClients(int maximumRows, int startRowIndex, string filterExpression, string sortExpression, out int count)
{
APADataContext db = new APADataContext();
var query = from c in db.vw_clients
select c;
//Set filter expresion
if (!String.IsNullOrEmpty(filterExpression))
{
query = query.Where(String.Format(@"{0}", filterExpression));
}
if (!String.IsNullOrEmpty(sortExpression))
{
query = query.OrderBy(sortExpression);
}
else
{
query = query.OrderBy("RecordAccountName Asc");
}
//Set the total row count
count = query.Count();
var pagedData = query.Skip(startRowIndex).Take(maximumRows);
return pagedData;
}
Filtering on that column in lowercase such as typing in 'jones' and using contains will not show in the grid even if I step through and see that I am returning a row of data. Typing in 'Jones' and filtering that way works fine. I think i am doing something wrong with my NeedDataSource event.
Here is my code ( i am using Custom paging):
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
int count = 0;
RadGrid1.DataSource = ClientBLL.GetPagedClients(RadGrid1.PageSize, RadGrid1.MasterTableView.CurrentPageIndex * RadGrid1.PageSize, RadGrid1.MasterTableView.FilterExpression, currentsort.Value, out count);
RadGrid1.MasterTableView.VirtualItemCount = count;
}
Here is the code for retrieving the data:
public static IQueryable<APAPortal.vw_client> GetPagedClients(int maximumRows, int startRowIndex, string filterExpression, string sortExpression, out int count)
{
APADataContext db = new APADataContext();
var query = from c in db.vw_clients
select c;
//Set filter expresion
if (!String.IsNullOrEmpty(filterExpression))
{
query = query.Where(String.Format(@"{0}", filterExpression));
}
if (!String.IsNullOrEmpty(sortExpression))
{
query = query.OrderBy(sortExpression);
}
else
{
query = query.OrderBy("RecordAccountName Asc");
}
//Set the total row count
count = query.Count();
var pagedData = query.Skip(startRowIndex).Take(maximumRows);
return pagedData;
}