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

[Solved] Datetime filter textbox not set to empty after clicking on NoFilter menuitem

2 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Samnang
Top achievements
Rank 1
Samnang asked on 08 Sep 2009, 09:28 PM
Hi,

I have one issue with Datetime filter textbox not set to empty after clicking on NoFilter menu item. Is there any solution for that?

Thanks,
Sam

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Sep 2009, 10:09 AM
Hello Sam,

I could not replicate this issue at my end and i'm not really sure as to why this happens at your end. But probably you can get around this by using the following code:
c#:
protected void RadGrid_PreRender(object sender, EventArgs e) 
    { 
        GridFilteringItem filteringitem = (GridFilteringItem)RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0]; 
        foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns) 
        { 
            if (column is GridBoundColumn && column.UniqueName == "DateTimeColumnUniqueName"
            { 
                if (column.CurrentFilterFunction == GridKnownFunction.NoFilter) 
                { 
                    (filteringitem["DateTimeColumnUniqueName"].Controls[0] as RadDatePicker).Clear(); 
                } 
            } 
        } 
    } 

Hope this helps..
Princy.
0
Samnang
Top achievements
Rank 1
answered on 09 Sep 2009, 10:46 PM
Thanks Princy,

Actually the way I am implementing filtering is via web service method, it does not do either postback or asyn postback to server.The solution you gave is server side only. I want solution on client side (javascript) to handle that.

Thanks,
sam
Tags
Grid
Asked by
Samnang
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Samnang
Top achievements
Rank 1
Share this question
or