Problem: after put rgDataRetrieval.MasterTableView.FilterExpression=... on grid PreRender makes grid all the column filter function not work. Please help!
I have a radgrid, has allow filter for all the columns turn to true.
I also need to have a date manually filtered by a search button click to filter the datagrid manually by start and end date.
I put the following code on PreRender, the serach button manually filter works fine, but after put
rgDataRetrieval.MasterTableView.FilterExpression=... in PreRender, the grid column auto filter for all the columns does not work right- not work at all
protected void rgDataRetrieval_PreRender(object sender, EventArgs e)
{
DateTime startDate =Convert.ToDateTime("1/1/1900");
DateTime endDate = Convert.ToDateTime("1/1/2900");
if (rdpFrom.SelectedDate!=null)
startDate=rdpFrom.SelectedDate.Value;
if (rdpTo.SelectedDate!=null)
endDate=rdpTo.SelectedDate.Value.AddDays(1);
if (rdpFrom.SelectedDate != null || rdpTo.SelectedDate != null)
{
rgDataRetrieval.MasterTableView.FilterExpression =
null;
rgDataRetrieval.MasterTableView.FilterExpression =
"(([DownloadEnd] >= '" + startDate +
"') AND ([DownloadEnd] <= '" + endDate + "')) ";
rgDataRetrieval.MasterTableView.Rebind();
}
}