Telerik Forums
UI for ASP.NET MVC Forum
1 answer
124 views

Hello Everyone,
You can use the Spreadsheet Demo on the Telerik Web site.
Select one of the numeric values in the quantity column and choose Data Validation -> List.
Write H1:H3 on the Value for validation and fill the range with values.

Now make sure you enter a number that fails validation. You receive correctly the error dialog.
Close it and Check the Data Validation Rule for that cell.
It has changed to: _matrix(H1:H3)
Now perform more failed validations (closing the dialogs).
Check again Data Validation Rule for that cell.
It has changed to more nested "_matrix" such as "_matrix(_matrix(H1:H3))"

This process of corruption continues with side effects such as: dialog opened as many times as the number of _matrix in the Data Validation Value.
Tested on IE Edge, IE 11 and Firefox 47.0.1 with same results.

Best Regards

Veselin Tsvetanov
Telerik team
 answered on 11 Aug 2016
1 answer
189 views

Hi, I would like to validate ressource in a scheler

        @(Html.Kendo().Scheduler<SchedulerCustomViewDemo.Models.MeetingViewModel>()
    .Name("scheduler")
    .Date(new DateTime(2016, 6, 13))
    .StartTime(new DateTime(2016, 6, 13, 7, 00, 00))
    .Height(600)
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
        views.AgendaView();
        views.CustomView("kendo.ui.ToDoView", view => view.Title("To Do").Selected(true));
    })
    .Timezone("Etc/UTC")
    .Resources(resource =>
    {
        resource.Add(m => m.RoomID)
            .Title("Room")
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")

            .BindTo(new[] {
                    new { Text = "Meeting Room 101", Value = 1, Color = "#6eb3fa" },
                    new { Text = "Meeting Room 201", Value = 2, Color = "#f58a8a" }
           });
        resource.Add(m => m.Attendees)
            .Title("Attendees")
            .Multiple(false)
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")
            .BindTo(new[] {
                    new { Text = "Alex", Value = 1, Color = "#f8a398" },
                    new { Text = "Bob", Value = 2, Color = "#51a0ed" },
                    new { Text = "Charlie", Value = 3, Color = "#56ca85" }
           });
    })
    .DataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.MeetingID);
            m.Field(f => f.Title).DefaultValue("No title");
            m.RecurrenceId(f => f.RecurrenceID);
        })
        .Events(e => e.Error("error_handler"))
        .Read("Meetings_Read", "Home")
        .Create("Meetings_Create", "Home")
        .Destroy("Meetings_Destroy", "Home")
        .Update("Meetings_Update", "Home")
    )
        )

So I would like to valide the Attendee  Field so as to make it required but it is not possible to apply .HtmlAttribute to .Ressource :

(HtmlAttributes(new { required = "required", data_required_msg = "Select start time", style = "width: 220px" }))

       resource.Add(m => m.Attendees)
            .Title("Attendee")
            .Multiple(false)
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")
            .BindTo(new[] {
                    new { Text = "Alex", Value = 1, Color = "#f8a398" },
                    new { Text = "Bob", Value = 2, Color = "#51a0ed" },
                    new { Text = "Charlie", Value = 3, Color = "#56ca85" }
           });

Regards
Veselin Tsvetanov
Telerik team
 answered on 11 Aug 2016
9 answers
215 views

Hello, 

I use a grip component from UI for ASP.NET MVC and I have a problem with localization of the grid. 

The problem is on image "grid1.png". In a red rectangle there is the wrong localized text and in a green rectangle there is the right/correct localized text.

I'm loading these javascripts on the web page (where variable culture is "cs-CZ"):

<script src="@Url.Content("~/Scripts/kendo/cultures/kendo.culture." + culture + ".min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/messages/kendo.messages." + culture + ".min.js")"></script>
 
<script>
        $(document).ready(function () {
            kendo.culture("@culture"); //culture of your choice
            $.validator.addMethod('date',
               function (value, element) {
                   return this.optional(element) || kendo.parseDate(value)
               });
        });
</script>

All javascripts, which are loaded on the web page, are on image "scripts.png". 

Could you help me? 

Thank you for your advice.

 

Maria Ilieva
Telerik team
 answered on 10 Aug 2016
3 answers
74 views

Hi,

I need a stockchart with none aggregate data, so I have to set:

          categoryAxis: {  baseUnit:"days", },

But then all labels are overlapped.

In the Navigator event I set axis.labels.step.

But this has no effect immediately: it is used in the next Navigator event.

http://dojo.telerik.com/usARa

1. Start dojo: all labels are overlapped
2. Change Navigator range: Chart is updated, newstep is assigned (see log), but has no effect on the labels
2. Change Navigator again: Chart is updated, newstep is assigned, label step is shown from last call.

 

If I call $("#stock-chart").data("kendoStockChart").refresh(); it works, but it needs long time to redraw the whole chart.
Without redraw the chart line is updated very fast.

Is a solution to apply immediately axis.labels.step = newStep;
without the slow chart refresh()?

Peter

 

Iliana Dyankova
Telerik team
 answered on 10 Aug 2016
1 answer
214 views

Hi!

I've got a small MVC application with hierarchical Kendo UI MVC Grid in it. Here is the code for the main grid.

01.Html.Kendo().Grid<PurchaseStageViewModel>()
02. .Name("purchaseStagesGrid")
03. .ToolBar(toolbar =>
04. {
05.     if (!Model.ReadOnly)
06.     {
07.         toolbar.Create();
08.     }
09. })
10. .Editable(e => e.Mode(GridEditMode.InLine).CreateAt(GridInsertRowPosition.Bottom))
11. .Resizable(resize => resize.Columns(true))
12. .Columns(c => {
13.     c.Bound(s => s.Name);
14.     c.Bound(s => s.StartDate).Format("{0:dd.MM.yyyy}");
15.     c.Bound(s => s.EndDate).Format("{0:dd.MM.yyyy}");
16. })
17. .DataSource(d => d.Ajax().
18. Model(m =>
19. {
20.     m.Id(p => p.Id);
21. })
22. .Read(a => a.Action("GetStages","PurchaseStage"))
23. .Create(a => a.Action("CreateStage", "PurchaseStage"))
24. .Update(a => a.Action("UpdateStage","PurchaseStage"))
25. .Destroy(a => a.Action("DeleteStage", "PurchaseStage"))
26. )
27. .ClientDetailTemplateId("childStagesTemplate")

And this code is for details.

01.<script id="childStagesTemplate" type="text/kendo-tmpl">
02.    @(
03.    Html.Kendo().Grid<purchaseStageViewModel>()
04.    .Name("grid_#=Id#")
05.    .TableHtmlAttributes(new {@class ="k-grid-nested" })
06.    .ToolBar(toolbar =>
07.    {
08.        toolbar.Create());
09.    })
10.    .Editable(e => e.Mode(GridEditMode.InLine).CreateAt(GridInsertRowPosition.Bottom))
11.    .Resizable(resize => resize.Columns(true))
12.    .Columns(c =>
13.    {
14.        c.Bound(s => s.Name);
15.        c.Bound(s => s.StartDate).Format("{0:dd.MM.yyyy}");
16.        c.Bound(s => s.EndDate).Format("{0:dd.MM.yyyy}");
17.        c.Command(command =>
18.            {
19.                command.Edit();
20.                command.Destroy();
21.            });
22.    })
23.    .DataSource(d => d.Ajax().
24.    Model(m =>
25.    {
26.        m.Id(p => p.Id);
27.        m.Field(p => p.Id).DefaultValue(default(long));
28.        m.Field(p => p.ParentStageId).DefaultValue("#=Id#"); //ParentStageId - is a string type
29.    })
30.    .Read(a => a.Action("GetNestedStages", "PurchaseStage", new { parentStageId = "#=Id#" }))
31.    .Create(a => a.Action("CreateStage", "PurchaseStage",new { parentStageId = "#=Id#" }))
32.    .Update(a => a.Action("UpdateStage", "PurchaseStage"))
33.    .Destroy(a => a.Action("DeleteStage", "PurchaseStage"))
34.    )
35.    .ClientDetailTemplateId("testTemplate")
36.    .ToClientTemplate()
37.    )
38.</script>

Actualy this grid appears to be recursive, so each detail contains it's own details grid. For DateTime fields I use Kendo DatePicker. 

So each row has StartDate and EndDate. I need to implement validation in all nested grids so the StartDate and EndDate properties of nested grids could be selected only in StartDate  and EndDate range of parent row. Is there any way to implement it?

Daniel
Telerik team
 answered on 10 Aug 2016
6 answers
288 views

Hello. I've got telerik.ui.for.aspnetmvc.2016.2.714.commercial installed and I've got the MVC6 samples running (C:\Program Files (x86)\Telerik\UI for ASP.NET MVC Q2 2016\wrappers\aspnetmvc\Examples\MVC6\Kendo.Mvc.Examples). Very cool! 

I can't seem to find the mention of Diagram anywhere out there. I noticed it isn't supported in the "core" version of Telerik.UI.for.AspNet.Core per the GITHUB page:
https://github.com/telerik/kendo-ui-core

It shows Diagram is supported in "Professional" but I'm unable to find a sample of someone using the professional Kendo with ASP.NET Core.

Anyone figured this out?

Amstrong
Top achievements
Rank 1
 answered on 10 Aug 2016
1 answer
415 views

ASP.NET MVC Core app

 

I get "elem.getClientRects is not a function" when clicking on the control to open the calendar.  If I enter the date using text the control works but the calendar pop up never opens when clicked.

 

It worked with earlier jquery versions but when I moved to 3.1 (for compatibility with another lib) it stopped working.  I am using the kendo bootstrap themed libraries and bootstrap 3.3.7.

 

Thanks

 

Danail Vasilev
Telerik team
 answered on 10 Aug 2016
11 answers
2.2K+ views
I would like to create a custom Html helper for a Kendo grid. We have a particular view-model combination which will be used across multiple controllers. I would like to be able to create a custom help method for display a grid of these models. It would basically be a short cut to use in all the views so we wouldn't have to maintain the same code in many different files. I would like to call it like this:

@Html.Kendo().ConfigruationGrid();
@* or *@
@Html.ConfigurationKendoGrid();
And have it output all the bells and whistles of a full grid declaration, like this:
@(Html.Kendo().Grid(@Model)
    .Name("KnockoutQuestions")
    .DataSource(datasource => datasource
        .Ajax()
        .Model(model =>
            {
                model.Id(k => k.Id);
                model.Field(k => k.Id).Editable(false);
                model.Field(k => k.Enabled).DefaultValue(true);
            })
        .Events(events => events.Error("Error"))
        .Create(create => create.Action("Create", "KnockOutQuestion"))
        .Read(read => read.Action("Read", "KnockOutQuestion"))
        .Update(update => update.Action("Update", "KnockOutQuestion"))
    )
    .Columns(columns => {
        columns.ForeignKey(k => k.AdminLeadType,
            new SelectList(from pair in BaseKnockOutQuestionModel.EnumLeadTypes select new { text = pair.Value, value = pair.Key },
                   "value", "text"));
        columns.ForeignKey(k => k.QuestionTypeId,
            new SelectList(from pair in BaseKnockOutQuestionModel.QuestionTypes select new { text = pair.Value, value = pair.Key },
                   "value", "text"));
        columns.Bound(k => k.QuestionText);
        columns.Bound(k => k.Answer1Text);
        columns.Bound(k => k.Answer2Text);
        columns.Bound(k => k.Price);
        columns.Bound(k => k.Enabled);
        columns.Command(command => command.Edit());
    })
    .ToolBar(toolbar => { toolbar.Create(); })
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Filterable()
    )
I know how to do custom Html helper methods, but I haven't found any examples of how to do a shortcut like this. It's probably something simple like using the "this HtmlHelper helper" param to execute and return the output of the Kendo().Grid() function. I wanted to ask anyways so I could hopefully avoid common mistakes/pitfalls.
Dimo
Telerik team
 answered on 10 Aug 2016
2 answers
143 views

Hi,

A error was encounted when I installed Telerik.UI.for.Aspnet.Core (v2016.2.714) by NuGet in VS2015. The error detail is as the attached file.

Could you please help to check them and tell me how to install it correctly. Is there any special setting in VS2015 for the installation?

BTW, I can't submit support ticket through login of my account now (investigating cause), I want to get your help from here as suggest from your support team.

 

Regards,

Amstrong

Aug.8, 2016

Amstrong
Top achievements
Rank 1
 answered on 10 Aug 2016
1 answer
353 views

Hello,

I have a grid with a  Editor Template with one TextBox and a Upload Control (see Code)

in the Upload Control Client Event "Success" I want to set the filename to the TextBox Control - how to Access the TextBox Control in edit mode of the template from this Event?

@model string
@using Kendo.Mvc.UI
 
@Html.TextBoxFor(model => model, new { @class = "k-textbox" })
@(Html.Kendo()
            .Upload()
            .Multiple(false)
            .Messages(m => m.HeaderStatusUploaded("Erfolgreich"))
            .Messages(m => m.Select("Word Dokument hochladen..."))
            //.HtmlAttributes(new { accept = "application/pdf" })
            .Name("Wordvorlage1Upload")
            .Async(a => a
            .Save("Save", "Auszeichnungsart")
            .AutoUpload(true)
          )
         .Events(events => events
              .Upload("onUpload")
              .Success("onUploadSuccess")
          )
)

the Javascript Events

function onUpload(e) {
        //var grid = $("#grid").data("kendoGrid");
        //grid.saveChanges();
        e.data = { Auszeichnungsart_ID: $("#Auszeichnungsart_ID").val() };
    }
 
    function onUploadSuccess(e) {
        alert(e.files[0].name);

    here I want to set the TextBox value of the edit template

        var grid = $("#grid").data("kendoGrid");
        grid.dataSource.read();
    }

Eyup
Telerik team
 answered on 09 Aug 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?