0
votes

Hi I would like to ask how can i filter the current contents of the Telerik mvc grid by the selected value in Html.Telerik().DropDownList?

I think there's some js scripts needed which I'm figuring out.

Thanks in advance.

-Lawrence

1

1 Answers

2
votes

In your dropdownlist's onchange event:

.ClientEvents(events => events
       .OnChange(
       @<text> function(e) { $('NameOfGrid').data('tGrid').rebind(); }
       </text>))

and in your grid's ondatabinding event:

.ClientEvents(e => e
            .OnDataBinding(
                @<text> function(a) { a.data = $.extend(a.data,{ dropdownlist: $('#dropdownlist').val()}); }
                </text>)
            )

In your controller, add the dropdownlist parameter to your GridAction and perform your action.