I recently came across a strange issue happening with the kendo Scheduler regarding firing off change events.
I have a custom event handler set so that when a user clicks on an item in the Scheduler it opens a link to a separate details page (in a new tab). The problem is that after doing this, other (unrelated) UI elements in the Scheduler will fire off the exact same event when I click on them.
You can actually see this behavior on the Scheduler Events sample page here: http://demos.telerik.com/kendo-ui/scheduler/events
To replicate:
Click on the Month View button.
Click on (highlighting) the item "HR Lecture", on the 06th. This will fire off a Change event.
Now click on the Month View button again. In between the dataBinding and dataBound events, another Change event will fire off for the same time slot. (Prior to clicking on HR Lecture, this is not the case. You'll only see events for navigation, dataBinding, and dataBound events)
This doesn't seem to happen with all events, HR Lecture just appears to be one that *does* trigger the behavior.
Is this expected? If so, is there any way to prevent this from happening?
Hi all,
I am trying to display an object in a Kendo grid in a MVC Website, however this object contains a dictionary and it seems like the grid is unable serialize it.
This is the error message I am getting:
Type 'System.Collections.Generic.Dictionary`2[[ExactModels.SalesOrderLine, ExactModels, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[ExactModels.Item, ExactModels, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' is not supported for serialization/deserialization of a dictionary, keys must be strings or objects.
I am using Kendo.Mvc.dll version 2015.2.902.545.
And this is the object which contains the dictionary that is causing the problem.
public class CustomOrder{ [Key] public Guid ID { get; set; } //public SalesOrder salesOrder { get; set; } private SalesOrder order; public SalesOrder salesOrder { get { return order; } set { order = value; if (order != null) { this.ID = order.OrderID; } } } public Account account { get; set; } public Dictionary<SalesOrderLine, Item> salesOrderLineItem { get; set; } public Boolean Checked { get; set; }}Anyone any idea of how to fix this?
Thanks in advance.
Please find the below code as i want to set default value of dropdown instead of optionlable from JSON data which is returned
from controller .
Please find the below code
public ActionResult GetOrders()
{
List<usp_IDQ_GetLicenseDistrictsVO> objresult1 = new List<usp_IDQ_GetLicenseDistrictsVO>();
objresult1 = objConnection.usp_IDQ_GetLicenseDistricts(User.Identity.Name, true).ToList();
return Json(objresult1, JsonRequestBehavior.AllowGet); ;
}
@(Html.Kendo().DropDownList()
.Name("DropDownList1")
//.Events(ev => ev.DataBound("SalesPersonID_DataBound"))
.OptionLabel("Select ...")
.HtmlAttributes(new { style = "width:300px" })
.OptionLabel("Select ...")
.DataTextField("District_Id")
.DataValueField("Location_ID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetOrders", "IDTDashboard");
})
.ServerFiltering(true);
})
.AutoBind(false)
I would like to setup a validation rule that would conditionally be applied. For example
I have three fields
Status: Enum field (pending, approved, denied)
Denied Code: (price, qty, misc..., ect...)
Comment (Long text)
So if the Status is equal to denied I want the Denied Code and Comment to require an update otherwise ignore them. Is this possible? and if so how would I go about doing this? Also the value of the Denied Code must not equal none.
My Index page:
<style> .cont { padding-right: 10%; padding-left: 10%; margin-right: auto; margin-left: auto;}</style><div class="cont"> @(Html.Kendo().Grid<Portal.Model.DAX.PurchaseJournalTransaction>() .Name("grid") .Columns(columns => { columns.Bound(c => c.PurchId).Title("Order Id").Width(120); columns.Bound(c => c.LineNum).Title("Line").Width(80).Hidden(true).IncludeInMenu(true); columns.Bound(c => c.ItemId).Width(120); columns.Bound(c => c.ExternalItemId).Title("External Id").Width(120); columns.Bound(c => c.Name).Width(400); columns.Bound(c => c.DeliveryDate).Width(140).Format("{0:MM/dd/yy}"); columns.Bound(c => c.PurchUnit).Width(75).Title("Unit"); columns.Bound(c => c.Quantity).Width(120).Format("{0:#,##0}"); columns.Bound(c => c.PurchasePrice).Width(100).Title("Price").Format("{0:$ #,##0.00}"); columns.Bound(c => c.LineAmount).Width(160).Hidden(true).IncludeInMenu(true).Format("{0:$ #,##0.00}"); columns.Bound(c => c.LineDiscount).Width(80).Hidden(true).IncludeInMenu(true); columns.Bound(c => c.LinePercent).Width(80).Hidden(true).IncludeInMenu(true); columns.Bound(c => c.ApprovalStatus).Width(130).EditorTemplateName("ApprovalStatusEditor").Title("Status"); columns.ForeignKey(c => c.ApprovalReasonId, (System.Collections.IEnumerable)ViewData["ApprovalReason"], "Id", "Description").Width(350).Title("Denied Code"); }) .ToolBar(toolbar => { toolbar.Excel(); toolbar.Save(); }) .Editable(editable => editable.Mode(GridEditMode.InCell)) .Pageable(p => p.PageSizes(true).PageSizes(new int[] {20,50,100,1000})) .Navigatable() .Filterable(filtering => filtering.Enabled(true)) .Groupable() .Sortable(s => { s.SortMode(GridSortMode.MultipleColumn); s.AllowUnsort(true); }) .ColumnMenu() .Scrollable(scrollable => { scrollable.Enabled(true); scrollable.Height(700); }) .DataSource(dataSource => dataSource .Ajax() .PageSize(20) .Model(model => { model.Id(p => p.CompanyId); model.Field(c => c.PurchId).Editable(false); model.Field(c => c.LineNum).Editable(false); model.Field(c => c.ItemId).Editable(false); model.Field(c => c.ExternalItemId).Editable(false); model.Field(c => c.Name).Editable(false); model.Field(c => c.CurrencyCode).Editable(false); model.Field(c => c.PriceUnit).Editable(false); model.Field(c => c.Quantity).Editable(false); model.Field(c => c.PurchUnit).Editable(false); model.Field(c => c.PurchasePrice).Editable(false); model.Field(c => c.DeliveryDate).Editable(false); model.Field(c => c.LineAmount).Editable(false); model.Field(c => c.LineDiscount).Editable(false); model.Field(c => c.LinePercent).Editable(false); }) .Read(read => read.Action("PurchaseJournalTransactions_Read", "Approval")) .Update(update => update.Action("PurchaseJournalTransactions_Update", "Approval")) ) ) <br /></div>Hello, I just started working with the product. I created a grid using the MVC control. Also, the grid is using a custom pop up form when editing/creating a record.
Inside that custom form, I added a multiselect control. The control should reference values stored in a child table from the record, basically I want to store multiples agencies a person can belong to. The model have a reference to the child table.
When submitting the form, the entity object knows that I selected X amount of companies, but I cant get to the values. What is the best way of doing this for a child table?
<label for="Agency" class="required col-sm-3 control-label" style="text-align:left;margin-right:-55px">Insurance Companies</label>
@(Html.Kendo().MultiSelect()
.Name("tblAgentInsurers")
.DataTextField("InsuranceAgencyName")
.DataValueField("InsuranceAgencyID")
.Placeholder("Select agencies...")
.HtmlAttributes(new { @class = "col-sm-2 form-control", style = "width:70%; height:auto; min-height: 34px;" })
.AutoBind(false)
.Filter(FilterType.Contains)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetAgencies", "Agents");
})
.ServerFiltering(true);
})
)
Hi
I have textbox, a button and a Grid in my screen, i am binding data to it on a button click with the textbox input.
If the user clicks the button again with different inputs, i have to go to DB, get data and append the new data to the existing Grid data.
I should not lose the existing data and i need to append new data to the same grid I should be able to call the same URL to get data.
Please let me know how I can achieve this.
Sample Code:
<input type="text" class="k-textbox"/>
<button id="btnAdd">Add</button></td>
<div id="grid"></div>
<script>
$("#btnAdd").on('click', function () {
$("#grid").kendoGrid({
dataSource: {
type: "json",
transport: {
read:
{
url: // my url with textbox inputs,
cache: false
}
},
schema: {
model: {
fields: {
ID: {type: "string"},
Name: {type: "String"}
}
}
},
columns: [
//{ hidden: true, field: "AssetID", editable: false },
{ template: "<input type='checkbox' class='checkbox' />" },
{ field: "ID"},
{ field: "Name"}]
}).data("kendoGrid");
});
});
</script>