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

[Solved] Accessing Filter text at server side :

5 Answers 239 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 10 Apr 2009, 05:45 AM
Hi,

    I have a column with one basic filter as shown :

<telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
                        UniqueName="Name" AllowFiltering="True" ShowFilterIcon="True">

1) Datafileld is of type String. Here instead of displaying all filter choices when i open filter menu, i need to show only some, say 4 in it.         How to customize this filter menu.

2) On select of item in filter menu i need to access particular( either Equalto, Contains ...) text at serverside.

For second one control is falling to below shown function, but e.commandName is "Filter".. not the selected filteroption in filter.

protected void rgIssues_ItemCommand(object sender, GridCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            }
       } 

Can anyone go through it and give any suggestions:

Thanks
Josh

5 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 10 Apr 2009, 03:57 PM
Hi Josh,

To achieve the desired functionality I suggest that you access the filter information in the ItemCommand event handler. It saves this information to a set of messages that can be displayed (by the grid's DataBound event handler) to provide feedback about the current filter function.
Please look at the following help topic for more information.
Operating with the FilterExpression of Telerik RadGrid manually

You can also customize the filter operation by setting the table view's FilterExpression. For details on how to do this, see Custom option for filtering  

I hope this information helps.

Best wishes,
Pavlina
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Josh
Top achievements
Rank 1
answered on 15 Apr 2009, 02:36 PM
Hi,

    Thanks for that.

     There is one more small issue which can be figured out by you easily. Here i have implemented to one of the column as follows :

<telerik:GridBoundColumn DataField="Id" HeaderText="Id" ReadOnly="true" SortExpression="IssueId"
                        UniqueName="Id" FilterControlWidth="40" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"                                                 ShowFilterIcon="False">
</telerik:GridBoundColumn>


   Here the problem is after entering certain value into filter textbox and when pressed enter, control is not going to .cs page. When i clickk on grid or beside of it then control goes to .cs page. I need to pass control to .cs page on enter. I have executed my prj in crome.

Thanks,
Josh
0
Pavlina
Telerik team
answered on 17 Apr 2009, 03:41 PM
Hi Josh,

I suggest that you try handling the ItemCommand event of your RadGrid and see if the event is fired when you click enter.
Find more information about this event in the following help article.

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Josh
Top achievements
Rank 1
answered on 21 Apr 2009, 01:36 PM
Hi,

    My total functionality is in ItemCommand event as :

protected void rgIssues_ItemCommand(object sender, GridCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "Filter" :   ..............
            }
       }

   I have put break point and tested it, but control doesn't enter into this shown case on press of "Enter". Is that i am missing any thing. Can you please suggest me on this small issue.



Thanks,
Josh.
0
Pavlina
Telerik team
answered on 24 Apr 2009, 09:39 AM
Hello Josh,

I followed your scenario in order to replicate the issue but to no avail. Find attached a small runnable project with the implementation request by you. Give it a try and see if it works as expected.

Kind regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Josh
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Josh
Top achievements
Rank 1
Share this question
or