Hello,
I'm new to the Kendo UI stuff, so please forgive me if this is an easy one; I've been trying to find some details that might tell me what I'm doing wrong, but nothing so far.
Based on radio selection I need to populate the dropdownlist values and grid. I am binding the values to dropdownlist and grid using Viewdata. Initially while loading the View there is no probelm grid and dropdownlist are loaded perfectely. but when i change the radio selection, it is not updating the grid and drodown list but data is reflected in view data.
usign this below function i am calling the controller
function Frequency(Mode) {
var json = {
'Frequency': Mode
}
$.ajax({
url: '@Url.Action("Index", "Pricing")',
type: 'Post',
data: json,
success: function (data) {
$("#cboPricingDates").data("kendoDropDownList").dataSource.read();
$("#PricingGrid").data("kendoGrid").dataSource.read();
alert("OK");
}
});
}
and this is my controller
[HttpPost]
public ActionResult Index(string Frequency)
{
LoadFundDates(Frequency); // this will update the viewdata of dropdown and viewdata of grid
return View();
}
and my dropdownlist in view
@Html.Kendo().DropDownList().Name("cboPricingDates").BindTo((IEnumerable<SelectListItem>)ViewData["PricingDates"])
and my grid
@{Html.Kendo().Grid((List<SAM.Enrol.Prg.Contract.VendorPricingGrid>)ViewData["PricingGrid"])
.Name("PricingGrid")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(25)
.Model(q => q.Id(m => m.ProdId))
.Model(q => q.Id(m => m.Ccy))
.Model(q => q.Id(m => m.Cat))
)
.Columns(columns =>
{
// Columns goes here
})
.Resizable(resizing => resizing.Columns(true))
.Scrollable(scrolling => scrolling.Enabled(true).Height(600))
.Sortable(sorting => sorting.Enabled(true))
.Groupable(grouping => grouping.Enabled(true))
.Filterable(filtering => filtering.Enabled(true))
.Reorderable(reorder => reorder.Columns(true))
.Pageable(Pageable => Pageable.Enabled(true).PreviousNext(true).Input(true).PageSizes(true).Refresh(true))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.ProdId))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.Ccy))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.Cat))
.Selectable(s => s.Mode(GridSelectionMode.Single).Enabled(true))
.Render();
}
Please help me to resolve this issue.
I'm new to the Kendo UI stuff, so please forgive me if this is an easy one; I've been trying to find some details that might tell me what I'm doing wrong, but nothing so far.
Based on radio selection I need to populate the dropdownlist values and grid. I am binding the values to dropdownlist and grid using Viewdata. Initially while loading the View there is no probelm grid and dropdownlist are loaded perfectely. but when i change the radio selection, it is not updating the grid and drodown list but data is reflected in view data.
usign this below function i am calling the controller
function Frequency(Mode) {
var json = {
'Frequency': Mode
}
$.ajax({
url: '@Url.Action("Index", "Pricing")',
type: 'Post',
data: json,
success: function (data) {
$("#cboPricingDates").data("kendoDropDownList").dataSource.read();
$("#PricingGrid").data("kendoGrid").dataSource.read();
alert("OK");
}
});
}
and this is my controller
[HttpPost]
public ActionResult Index(string Frequency)
{
LoadFundDates(Frequency); // this will update the viewdata of dropdown and viewdata of grid
return View();
}
and my dropdownlist in view
@Html.Kendo().DropDownList().Name("cboPricingDates").BindTo((IEnumerable<SelectListItem>)ViewData["PricingDates"])
and my grid
@{Html.Kendo().Grid((List<SAM.Enrol.Prg.Contract.VendorPricingGrid>)ViewData["PricingGrid"])
.Name("PricingGrid")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(25)
.Model(q => q.Id(m => m.ProdId))
.Model(q => q.Id(m => m.Ccy))
.Model(q => q.Id(m => m.Cat))
)
.Columns(columns =>
{
// Columns goes here
})
.Resizable(resizing => resizing.Columns(true))
.Scrollable(scrolling => scrolling.Enabled(true).Height(600))
.Sortable(sorting => sorting.Enabled(true))
.Groupable(grouping => grouping.Enabled(true))
.Filterable(filtering => filtering.Enabled(true))
.Reorderable(reorder => reorder.Columns(true))
.Pageable(Pageable => Pageable.Enabled(true).PreviousNext(true).Input(true).PageSizes(true).Refresh(true))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.ProdId))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.Ccy))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.Cat))
.Selectable(s => s.Mode(GridSelectionMode.Single).Enabled(true))
.Render();
}
Please help me to resolve this issue.