开发者

How to bind Telerik MVC grid to DropDownList via Ajax?

开发者 https://www.devze.com 2023-01-29 08:49 出处:网络
I am trying to bind a dropdownlist to a telerik grid, so that when the value of the dropdownlist changes the grid will update via ajax to show results. Here is my code so far:

I am trying to bind a dropdownlist to a telerik grid, so that when the value of the dropdownlist changes the grid will update via ajax to show results. Here is my code so far:

IndexView:

<% Html.RenderPartial("AptProfileFilter"); %> <%= Html.Telerik().Grid(Model.profiles)//Initial Server Binding .Name("Profiles").DataBinding(dataBinding => dataBinding

.Ajax()

.Update("_AjaxBinding", "AptProfile", new {id = (string)ViewData["BuildingID"]})) .Columns(columns => { columns.Bound(p => p.AptProfileID).Width(100); columns.Bound(p => p.Apartment.Building.Complex.Name).Width(100); columns.Bound(p => p.Apartment.Building.BuildingID).Width(100); columns.Bound(p => p.Apartment.AptRate).Width(100); }) .Pageable开发者_开发百科() .Sortable()

I used FireBug to determine that the correct data is being posted( after selecting a element from my dropdownlist) back to the Data collection in the GridModel class, but I do not understand why it is not updating the Grid with this new data?

I am very new to web development. Thanks for your help!


I've been wrestling with this too. take a look at the link below (bottom of comment), in which I asked the same type of question. In my case, I managed to get this working, but still have some questions about HOW I got it working. Anyway, I hope this helps ... Also, in my case, I'm using Razor views, which you might not be, based upon you use of the <% operators ... Telerik MVC Grid: How to use DropDownList in a column?

0

精彩评论

暂无评论...
验证码 换一张
取 消