This question is locked. New answers and comments are not allowed.
Consider that I have an action that returns this model to a view:
The view will have this code to show a grid that is sortable and filterable:
IEnumerable<TestModel> model = new[] { new TestModel{Name = "Filip Ekberg", City ="Gothenburg"}, new TestModel{Name = "Anders Andersson", City ="Halmstad"} }; return View(model);
The view will have this code to show a grid that is sortable and filterable:
It shows up fine and I can sort the column, but when I try press the Filter button, it's not a link anymore and it doesn't open up the Filter-dialog as it has done before. This is an empty/new solution that only has Telerik and latest jquery in it, I've attached a printscreen of the result. As you can see, the "Filter"-button looks "disabled". Any ideas?@(Html.Telerik().Grid(Model).Name("Grid").Columns(columns =>{columns.Bound(o => o.Name).Width(120);}).Pageable().Sortable().Filterable())
6 Answers, 1 is accepted
0
Hello Filip,
Atanas Korchev
the Telerik team
Filtering works fine in our online demos. Did you miss to add a ScriptRegistrar to your page? Check the troubleshooting help article for additional info.
All the best,Atanas Korchev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
fekberg
Top achievements
Rank 2
answered on 08 Dec 2011, 02:01 PM
You're absolutely right.
The script registrar had been removed for some reason. Thanks
The script registrar had been removed for some reason. Thanks
0
Hello Filip,
Atanas Korchev
the Telerik team
Your initial code snippet is using Razor. However your script declaration is for ASPX view engine (notice the <%= %>). You need to use the Razor syntax.
On a side note the grid filtering (as well as all other client-side features) will never work if you don't include a ScriptRegistrar in your page. There is no way the grid filtering could have worked without a ScriptRegistrar.
Atanas Korchev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
fekberg
Top achievements
Rank 2
answered on 08 Dec 2011, 03:02 PM
Hi,
I copied code from a different project, that's why I edited my answer and removed that snippet.
You can however mix ASPX / Raxor syntax in the same solution and AFAIK you can have a master-page with ASPX syntax and a partial view with Razor syntax.
Sorry for the confusion. I was a bit fast with the copy/pasting. :)
I copied code from a different project, that's why I edited my answer and removed that snippet.
You can however mix ASPX / Raxor syntax in the same solution and AFAIK you can have a master-page with ASPX syntax and a partial view with Razor syntax.
Sorry for the confusion. I was a bit fast with the copy/pasting. :)
0
Hello Fekberg,
Atanas Korchev
the Telerik team
Indeed you can mix ASPX and Razor. Was this the problem in your case? Did you manage to get it to work? If still struggling please attach some trimmed down version of your project which we can check.
Greetings,Atanas Korchev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
fekberg
Top achievements
Rank 2
answered on 08 Dec 2011, 04:42 PM
Hi,
No the problem was not a mixture of Razor and ASPX, the SriptRegistrar was not added, it must have been removed/never added.
It's a bit weird because it worked before and I can't remember removing it.
Well now everything works as supposed, thanks for your time.
No the problem was not a mixture of Razor and ASPX, the SriptRegistrar was not added, it must have been removed/never added.
It's a bit weird because it worked before and I can't remember removing it.
Well now everything works as supposed, thanks for your time.