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

Filtering a Grid through code

2 Answers 43 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 21 Oct 2008, 09:21 PM
I want to add filtering to my code to change the display of my grid.  I believe the FilterExpression is what I need.  However, I must be missing a reference as when I implement what is in the examples, the system does not recognize the command.

I have noticed this about all of the support topics.  There is never any referencing/imports information included.  Is that, perhaps, because it is located somewhere else?  I would think it critical information so maybe I just don't know where to go to get that information.

Thanks

2 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 24 Oct 2008, 04:08 PM
Hello Tony,

Thank you for this question.

Indeed, you should use FilterExpression in order to filter RadGridView programmatically. For the FilterExpression class, you need to include the Telerik.WinControls.Data namespace. You can find an example of using FilterExpressions in our Quick Start Framework application (aka Examples).

Regarding the support topics, you are correct. We do not include information about references, because when you drag and drop a control on the form, the needed assemblies are automatically referenced. As to the namespaces, when you write a string for an existing type, if you have the correct assembly referenced, Visual Studio marks this string with e red rectangle to show that you should include a namespace and gives suggestion for the namespaces. You can get a list of the suggestions either by clicking on the string and then on the little icon that will show up, or by clicking on the string and then pressing Shirt+Alt+F10 to get the little icon shown. Since Visual Studio makes these suggestions and people do not ask us back for the namespaces, generally, we do not have the practise to include the namespaces in the support topics. However, I want to thank you for raising this question. Once we notice that more people need including the namespaces in the topics, we will definitely start doing it.

I hope this helps. If you have additional questions, feel free to contact me.

Sincerely yours,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Tony
Top achievements
Rank 1
answered on 24 Oct 2008, 04:27 PM
Thanks.  Our team appreciates the tip on the lookup too.
Tags
GridView
Asked by
Tony
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Tony
Top achievements
Rank 1
Share this question
or