Telerik Forums
UI for ASP.NET MVC Forum
2 answers
149 views

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);

 

 

 

 

Vladimir Iliev
Telerik team
 answered on 22 Dec 2016
2 answers
83 views

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();
    }
});

 

Joe
Top achievements
Rank 1
 answered on 21 Dec 2016
9 answers
175 views

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!

Peter Milchev
Telerik team
 answered on 21 Dec 2016
1 answer
205 views

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

Konstantin Dikov
Telerik team
 answered on 21 Dec 2016
1 answer
223 views
Can you show me how I would modify the code found here http://demos.telerik.com/aspnet-mvc/grid/remote-data-binding for a combobox? I realize I can only use two columns (like OrderID and ShipCity) but I can't seem to make it work.
Konstantin Dikov
Telerik team
 answered on 21 Dec 2016
6 answers
244 views

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();
            }
Angel Petrov
Telerik team
 answered on 21 Dec 2016
5 answers
931 views

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) {
 
         ????
     }
 
 }

Konstantin Dikov
Telerik team
 answered on 21 Dec 2016
1 answer
507 views

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

 

 

 

Eyup
Telerik team
 answered on 20 Dec 2016
1 answer
479 views

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!

Christopher
Top achievements
Rank 1
 answered on 19 Dec 2016
1 answer
163 views

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?

Vessy
Telerik team
 answered on 19 Dec 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?