This is a migrated thread and some comments may be shown as answers.

grid Filter issues

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Soumya
Top achievements
Rank 1
Soumya asked on 23 Jul 2012, 07:33 AM

Please help me on the below issues in Radgrid.I am using NeedDataSource for binding the grid.

1)I have a radgrid and filter with textbox(AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Conatins") for Name. 
On typing letters in the filter textbox ,for example  if I type 'MUH',the GRID should be filled with all records with name starting with 'MUH' ,without pressing enter.
2)In GridDateTimeColumn,I have given filter option as "PickerType="DatePicker" EnableRangeFiltering="true"".Here in the filter box I am having filter options as BETWEEN,NOT BETWEEN,IS NULL,NOT IS NULL,NO FILTER.
Can I have the Filter with options BETWEEN & NOT BETWEEN only?
3)I have entered a name in filter textbox for Name column,pressed enter,fetched corresponding record.Now if I press Refresh button,I need to clear the textbox,and refresh the grid populated with all data.
Presently,my grid is showing the filtered record on refresh.

Highly appreciate your help on this.
Thanks,
Soumya

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 Jul 2012, 01:19 PM
Hi Soumya,

For the first requirement you could us the following property:
<telerik:GridBoundColumn ... CurrentFilterFunction="StartsWith" FilterDelay="2000">
In addition, you could check out the Google-like filtering functionality:
 Grid / Google-like Filtering

As for restricting some of the menu options, please refer to the topic below:
 Reducing the Filter Menu Options

The refresh button of the GridCommandItem only rebinds the grid without changing its Viewstate, therefore the grid preserves its filtered state upon refreshing. To reset the grid to its initial state, you could use the following approach:
protected void Button1_Click(object sender, EventArgs e)
{
    RadGrid1.MasterTableView.SortExpressions.Clear();
    RadGrid1.MasterTableView.GroupByExpressions.Clear();
    RadGrid1.CurrentPageIndex = 0;
    RadGrid1.MasterTableView.FilterExpression = "";
    RadGrid1.EditIndexes.Clear();
    RadGrid1.MasterTableView.IsItemInserted = false;
    RadGrid1.Rebind();
}

I hope this will prove helpful.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Soumya
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or