我需要更改下拉選擇更改的telerik mvc網格數據源。下面是我目前的觀點,我想用下拉選擇更改網格。動態更改網格數據源
<%@ Page Title="" Language="C#" MasterPageFile="~/ViewMasterPage.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<GateApplication.Models.Gate>>" %>
<%@ Import Namespace="Telerik.Web.Mvc.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div align="left" style="width: 100%">
<table><tr>
<td>Search Form: </td>
<td><%= Html.Telerik().DropDownListFor(model => ViewData["drpSearch"])
.HtmlAttributes(new { @Style="width:250px" })
.BindTo(new SelectList((List<SelectListItem>)ViewData["drpSearch"], "Text", "Value"))%></td>
</tr></table>
</div>
<br />
<%= Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.ID).Visible(false);
columns.Bound(o => o.Urgency);
columns.Bound(o => o.FullName);
columns.Bound(o => o.Email);
columns.Bound(o => o.GateSupportedBy);
columns.Bound(o => o.FullPhone1).Title("Phone Number");
columns.Bound(o => o.StNstNo).Title("St. and St. No.");
})
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("AjaxGrid",
"Gate").Enabled(true);
})
.Scrollable(scrolling => scrolling.Enabled(true))
.Sortable(sorting => sorting.Enabled(true))
.Pageable(paging => paging.Enabled(true).PageSize(10))
.Filterable(filtering => filtering.Enabled(true))
.Groupable(grouping => grouping.Enabled(true))
.Footer(true)
%>
</asp:Content>
問題是,如何從下拉變化事件的Telerik網格上的不同來源獲取數據。你的答案與問題無關。 – HaBo