Please provide link with example for Template function with the mentioned parameter
class GridColumnFilterableCellSettingsBuilder// Summary:
// Sets JavaScript function which to modify the UI of the filter input.
public GridColumnFilterableCellSettingsBuilder Template(Func<object, object> handler);
I have a form that has three dropdowns and a file upload control, all Kendo components. I'd like the initial state of the Upload component to be disabled until the user has selected the appropriate values from the dropdowns. I have all the dropdowns working appropriately, and their change events are all wired up, but I need to have the initial state of the uploader disabled until all three dropdowns have been answered, and then enable the upload.
In the uploader event, I have the select event wired into the validation, but it doesn;t actually fire until the user has selected a file, whereas I don;t want them to select the file even until the dropdowns have been answered. What is the best way to do this?
$(
"#FileUpload1"
).kendoUpload({
async: {
saveUrl:
"@Url.Action("
UploadFile
", "
Mapping
")"
},
upload:
function
(e) {
e.data = {
clientId: viewModel.get(
"ClientId"
),
uploadType: viewModel.get(
"uploadType"
),
payrollType: viewModel.get(
"payrollType"
)
}
},
multiple:
false
,
localization: {
"select"
:
"Select file to import..."
},
select:
function
(e) {
if
((viewModel.get(
"ClientId"
) ===
""
) ||
(viewModel.get(
"uploadType"
) ===
""
) ||
(viewModel.get(
"payrollType"
) ===
""
)) {
alert(
"Please Make All Appropriate Selections Before Uploading"
);
e.preventDefault();
return
;
}
var
extension = e.files[0].extension.toLowerCase();
if
(ALLOWED_EXTENSIONS.indexOf(extension) === -1) {
alert(
"Please, select a supported file format"
);
e.preventDefault();
return
;
}
},
success:
function
(e) {
spreadsheetWrapper.show();
// Load the converted document into the spreadsheet
$(
"#spreadsheet"
).data(
"kendoSpreadsheet"
).fromJSON(e.response);
$(
"#uploadForm"
).hide();
}
});
When I use Telerik.Windows.Documents.Core.dll(in this file path:C:\Program Files (x86)\Telerik\UI for WPF Q2 2016\Binaries\WPF45) and Telerik.Web.Spreadsheet.dd(in this file path: C:\Program Files (x86)\Telerik\UI for ASP.NET MVC R3 2016\spreadsheet\binaries\net40\Telerik.Web.Spreadsheet.dll), then will with this problem Telerik.Windows.Documents.Core, Version=2016.3.1021.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)":"Telerik.Windows.Documents.Core, Version=2016.3.1021.40. This example in the website :http://demos.telerik.com/aspnet-mvc/spreadsheet/server-side-import-export select file can not be use!
Please reply me quickly ,thank you!
Hello guys,
i have a problem with excel generated by kendo grid.
In my scenario, the exported file is uploaded, and processed using a OleDbConnection, with the driver Provider=Microsoft.ACE.OLEDB.12.0;Data Source=file.xlsx;Extended Properties=Excel 12.0.
With this file, and only with files generated by kendo, I always get this error:
"External table is not in expected format".
With excel files created manually, i have no problems.
I tried to change the type of driver, but it was useless.
Any ideas?
Thank you
Hi,
We have a grid, which has 2 columns, "Name" "Age". if user enters the Age as negative, then it will convert to positive all the time. eg, -32 to 32
In the grid event we have "event save" to trigger it to make positive value all the time by using Math.abs(Age). We can see the datasource has updated value, also after refresh() everything look good inside the "save" method, once it is out of the "save", the value gets rollback to the user's input as = -32 again. it seems like kendo has methods which puts it back. How can I get round it?
This happens only when we try to modify user's input in the same field. There is no problem if user change their name column, and we code to change age to positive
I set a breakpoint after "$("#NameAgeGrid").data("kendoGrid").refresh();" in the following code, and everything looks good. once I continue, it went to kendo's code "set: function (field, value) " and "set: function (field, value, initiator)" and then the value gets put back
thanks!
in cshtml:
.Events(e => e.Save("NameAgeGrid_onSave"))
in JS:
if ("Age" in e.values && e.values.Age != "") {
e.model.set("Age", Math.abs(e.values.Age));
e.model.Age = Math.abs(e.values.Age);
var datarow = $("#NameAgeGrid").data("kendoGrid").dataSource.getByUid(e.model.uid);
datarow.Age = Math.abs(e.values.Age);
$("#Age").val(Math.abs(e.values.Age)).change();
$("#NameAgeGrid").data("kendoGrid").refresh();
}
Hello,
I want to disable my ForeignKey DropDownListFor colums on edit but let them editable on new row...
how to find the DropDownList in the edit event and disable the dropdownlist?
function grid_edit(e) {
if (e.model.isNew() == false) {
????
}
}
Hi,
I have following kenodgrid
(Html.Kendo().Grid<SSAIFCN.Domain.evViewModel>()
.Name("evGrid")
.Columns(columns =>
{
columns.Bound(x => x.evId).Visible(false);
columns.Bound(x => x.PId).Title("Company").HeaderHtmlAttributes(new { style = "white-space: normal" }).EditorTemplateName("PEEditor") .ClientTemplate("#=CompanyName#")
columns.Command(command =>
{
command.Edit();
command.Destroy();
});
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.DataSource(dataSource => dataSource
.Ajax()
.Create(update => update.Action("CreateEV", "EVController"))
------------------PEEditor.cshtml
@model object
@(Html.Kendo().ComboBoxFor(m => m)
.DataTextField("PEtext")
.DataValueField("PEID")
.Placeholder("--Select--")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetPEData", "EVController"); //Set the Action and Controller names.
});
})
---------------- CreateEV controller
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult CreateEV([DataSourceRequest] DataSourceRequest request, evViewModel evt)
{
// create code here
}
Dropdown shows value perfectly in edit mode
Question: when I select he values and update/create the record I don't see any value in "evt.PID ". it is null.
In other words how do I get the value selected in dropdown to model grid and pass on create action
Thanks for your help
The MVC Kendo Grid supports a custom EditorTemplate via the EditorTemplateName property. Can you please provide an example showing how to apply a custom DisplayTemplate as well, or a ClientTemplate that allows the ForeignKey column to continue to function properly?
Thanks!
We're a bit confused about how to connect the release numbers with the release history page (http://www.telerik.com/support/whats-new/aspnet-mvc/release-history).
For example our version of Kendo UI for MVC is 2016.3.914, but the release history pages have titles (such as UI for ASP.NET MVC R3 2016) that can't easily be matched.
Is there a cross reference table somewhere?