Telerik Forums
UI for ASP.NET MVC Forum
3 answers
264 views

I hope I am explaining this correctly.

I am developing a Scheduling platform for my company.  Everything is going well, except for one thing.  Our users can take half days, or get meeting requests that can split one of their recurring shifts.

For example:

User A has a repeating schedule M-F 8 - 5
A request is submitted so that on Wednesday, he has a meeting from 2-3.

I am unsure how to handle this type of exception, I would like for his Wednesday schedule to show him working 8-2, then meeting, then 3-5 and not two entries showing a meeting and then his schedule.

Is this possible using Kendo or even in the RFC 5545 standard?

Is this going to have to be done programatically in that I search my calendar for the user, find his schedule and parse his recurrence than figure out what day he works and hours and enter multiple events so that there would be 3 exceptions for the scenario listed above?  (one for 8-2, one for 2-3, and one for 3-5)

Or is there a way to create the new meeting request from 2-3 then have that appointment's ID excepted from the recurrence rule?

Nencho
Telerik team
 answered on 09 Aug 2018
2 answers
977 views

Hallo,

i'm fairly new to Kendo UI MVC and am trying to rebuild an old app with the kendo grid in .net.

What i am trying to do is: Use the Grid in batch editing mode and allow in line editing on the client side. I have some problems with the client side validation of the grid data. The grid is filled with data from the Viewmodel. If the user hit's the "kontigente speichern" button i want to validate the existing rows, because the HOTEL field is empty by default, but the  $('#kontingenteHinzu').data().kendoGrid.editable.validatable.validate() method always comes back as "true" and try's to submit the grid data/ the page is reloaded. This happens although the HOTEL field is marked as required in the mvc view model. Additionally the KONTINGENT field ist only validated once it is clicked into, otherwise the validate() methoded just reloades the page. I do not use the build in "save changes" method because we use a seperate button in oure design/layout. If the user hit's the "+ Kontigent hinzufügen" button the existing rows should be validated bevor he can do that but i'm not sure how to accomplish this since the existing rows always return true with the validate() method, although they are not "valid".

Maybe someone has an idea how to get this working or even an easyer way with the build in grid methodes.

Kind regards

Marcus

Viewmodel

public class KontingentBuchung
 {
     public int LehrgangId {get;set;}
     public List<HotelKontigent> Kontingente {get;set;}
     public bool ShowModal {get;set;}
     public bool Success {get;set;}
     public string Message {get;set;}
 
 }
public class HotelKontigent
    {
        public int Id { get; set; }
 
        [Required(ErrorMessage ="Bitte ein Hotel eintragen")]
        public string Hotel {get;set;}
        [Required]
        [Range(1, Int32.MaxValue, ErrorMessage = "Bitte ein Kontingent eintragen")]
        public int Kontingent {get;set;}
        public DateTime Zeitraum {get;set;}
        public DateTime? Frist {get; set;}
    }

cshtmlview

@model Hotelinformationen.Models.KontingentBuchung
 
@{
    Layout = "~/Views/Shared/_BCWLayout.cshtml";
    bool hasFrist = false;
    DateTime firstDay = DateTime.Now;
    DateTime frist = DateTime.Now;
    var id = Model.LehrgangId;
    var first = Model.Kontingente.FirstOrDefault();
    if (first != null)
    {
        hasFrist = first.Frist.HasValue;
        firstDay = first.Zeitraum;
        if (hasFrist)
        {
            frist = first.Frist.Value;
        }
    }
 
     
}
@Model.LehrgangId
<div class="panel panel-primary panel-content z-depth-1 fade-in">
<div class="panel-heading">Veranstaltungen ohne Kontingente</div>
<div class="panel-body">
    <div class="row">
        <div class="col-xs-10 col-xs-push-1">
            @(Html.Kendo().Grid(Model.Kontingente)
                  .Name("kontingenteHinzu")
                  .Columns(cs =>
                  {
                      cs.Bound(c => c.Hotel).Width(500);
                      cs.Bound(c => c.Zeitraum).Format("{0:dd.MM.yyyy}").EditorTemplateName("Date").Width(150);
                      cs.Bound(c => c.Kontingent).Width(500);
                      cs.Bound(c => c.Frist).Format("{0:dd.MM.yyyy}").EditorTemplateName("Date").Width(150);
                      cs.Command(command => { command.Destroy().IconClass("fas fa-trash fa-2x").Text(" "); }).Width(75);
                  })
                  .ToolBar(toolBar =>
                  {
                      toolBar.Create().Text("Kontingent hinzufügen");
                  })
                  .Editable(editable => editable.Mode(GridEditMode.InCell)
                      .DisplayDeleteConfirmation(false)
                      .CreateAt(GridInsertRowPosition.Bottom))
                  .DataSource(ds => ds.Ajax()
                      .Batch(true)
                      .PageSize(20)
                      .Model(model =>
                      {
                          model.Id(k => k.Id);
                          model.Field(k => k.Kontingent).DefaultValue(0);
                          model.Field(f => f.Frist).Editable(false).DefaultValue(frist);
                          model.Field(k => k.Zeitraum).DefaultValue(firstDay);
 
                      })
                      .ServerOperation(false)
                  ))
        </div>
    </div>
</div>
</div>

 

marcus
Top achievements
Rank 2
 answered on 09 Aug 2018
5 answers
1.3K+ views

Hi,

I am using columns.Select() in my grid template in order to be able to select multiple rows with the provided checkboxes. The checkbox in the header normally works well, allowing me to select or deselect all rows.

However, I have tried this same approach on a 'filterable' grid, and the column header checkbox no longer works. In this case, when I click on the checkbox, instead of toggling the selection, the grid attempts to filter on the 'select' column.

Is there anyway to turn off filtering for the select column only?  I need filtering on the other columns, and I also need to be able to use the checkbox in the header of the 'select' column. Is this possible?

 

Thanks,

Ryan

Preslav
Telerik team
 answered on 09 Aug 2018
2 answers
114 views

I ran the upgrade wizard to upgrade my telerik version to 2018.2.620 from the Q2 2016 version. However, after the upgrade none of the grid icons are showing up. 

I'm using the bootstrap theme. 

In my content folder I have a kendo directory with folders for Bootstrap, fonts, images, textures and the kendo.bootstrap.min.css and kendo.common-bootstrap.min.css files. I've included a screen shot of the folder structure. 

The Scripts/kendo directory just has the kendo.all.min.js and kendo.aspnetmvc.min.js files. 

I have the following css and script file includes on the page:

<link href="~/Content/jquery-ui-1.11.4.min.css" rel="stylesheet" />
<link href="~/Content/kendo/kendo.common-bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/kendo/kendo.bootstrap.min.css" rel="stylesheet" />
<script src="~/Scripts/_lib/jquery-ui-1.11.4.min.js"></script>
<script src="~/Scripts/kendo/kendo.all.min.js"></script>
<script src="~/Scripts/kendo/kendo.aspnetmvc.min.js"></script>

 

I've confirmed using the dev tools in Chrome and using Fiddler that there are no 404's, all the files are getting loaded into the page correctly. 

 

I'm not using any bundler at all. The page just has a Html.Kendo().Grid defined and practically nothing else. I tried removing everything else on the page but the grid, but that didn't help.

 

What am I missing?

Jon
Top achievements
Rank 1
 answered on 08 Aug 2018
6 answers
852 views

Hello

As a reference I use the sample in https://demos.telerik.com/aspnet-mvc/grid/filter-multi-checkboxes. By clicking on the filter icon, a multi-check drop-down is displayed. I'd like to show a single selection drop-down (containing the distinct row values in the corresponding column as in the multi-check sample) instead of the multi-check drop-down. By clicking on one item in this drop-down, the grid content should be filtered using this selection. 

A code sample would be greatly appreceated. 

I'm using Kendo.Mvc Version 2018.2.516.545

Thank you and regards

Daniel 

Daniel
Top achievements
Rank 1
 answered on 08 Aug 2018
4 answers
159 views

How I can override alert from ImageBrowser from f.e "invalidFileType" ?

 

Because it is native web browser popup.

01.$("#editor").kendoImageBrowser({
02.            messages: {
03.                deleteFile: "@Html.Raw(ImageBrowser.DeleteFile.JsEscape())",
04.                directoryNotFound: "@Html.Raw(ImageBrowser.DirectoryNotFound.JsEscape())",
05.                emptyFolder: "@Html.Raw(ImageBrowser.EmptyFolder.JsEscape())",
06.                invalidFileType: "@Html.Raw(ImageBrowser.InvalidFileType.JsEscape())",
07.                orderBy: "@Html.Raw(ImageBrowser.OrderBy.JsEscape())",
08.                orderByName: "@Html.Raw(ImageBrowser.OrderByName.JsEscape())",
09.                orderBySize: "@Html.Raw(ImageBrowser.OrderBySize.JsEscape())",
10.                overwriteFile: "@Html.Raw(ImageBrowser.OverwriteFile.JsEscape())",
11.                uploadFile: "@Html.Raw(ImageBrowser.UploadFile.JsEscape())",
12.                dropFilesHere: "@Html.Raw(ImageBrowser.DropFilesHere.JsEscape())",
13.                search: "@Html.Raw(ImageBrowser.Search.JsEscape())"
14.            },
15.            transport: {
16.                type: "imagebrowser-aspnetmvc",
17.                read: "@Url.Action("ReadES", "ImageBrowser", new {id = Model.Id})",
18.                destroy: {
19.                    url: "@Url.Action("DestroyES", "ImageBrowser", new {id = Model.Id})",
20.                    type: "POST"
21.                },
22.                create: {
23.                    url: "@Url.Action("CreateES", "ImageBrowser", new {id = Model.Id})",
24.                    type: "POST"
25.                },
26.                thumbnailUrl: function (path, file) {
27.                    var url = "@Url.Action("ThumbnailES", "ImageBrowser", new { id = Model.Id })" + "?path=" + path + file;
28.                    return url;
29.                },
30.                uploadUrl: "@Url.Action("UploadES", "ImageBrowser", new { id = Model.Id })",
31.                imageUrl: "@Url.Action("Image", "ImageBrowser", new {path = "{0}", id = Model.Id})"
32.            }
33.        });
Veselin Tsvetanov
Telerik team
 answered on 08 Aug 2018
1 answer
1.3K+ views

The DateTimePicker & TimePicker close their respective animated picker when opened immediately in the following scenario:

  1. Kendo Grid is inside a Bootstrap modal.
  2. Kendo Grid has edit Popup that uses a Template.
  3. The Popup template uses the Kendo DateTimePicker AND/OR TimePicker.
  4. When editing the grid in the popup edit template, the DateTimePicker & TimePicker close their popups immediately when opened.

When I remove the grid from the Bootstrap modal, the behavior is corrected. 

Any advice would be appreciated. I don't have any example code readily available to demonstrate the behavior.

Preslav
Telerik team
 answered on 08 Aug 2018
2 answers
123 views

How can I remove the onclick border highlighting on the tabstrip?

 

Eyup
Telerik team
 answered on 08 Aug 2018
1 answer
80 views
@(Html.Kendo().Grid<sss.ViewModels.StudentMarkVM>()
 
               .Name("grid")
               .Columns(columns =>
               {
 
                   columns.ForeignKey(c => c.StudentId, (System.Collections.IEnumerable)ViewData["students"], "Id", "NameEn");
                   columns.Bound(c => c.Name).Hidden();
                   columns.ForeignKey(c => c.MarkStructureId, (System.Collections.IEnumerable)ViewData["markStructures"], "Id", "NameEn");
                   columns.Bound(c => c.Mark);
                   columns.Bound(c => c.FullMark);
                   //.ClientTemplate(Html.Kendo().NumericTextBox<double>()
                   //                            .Name("Mark_#=Mark#")
                   //                            //.Value("#=order#")
                   //                            .HtmlAttributes(new { value = "#=Mark #" })
                   //                            .Format("{0:n0}")
                   //                            .Min(0)
                   //                            .Max(100000)
                   //                            .Step(1)
                   //                            .Decimals(0)
                   //                            .Events(ev => ev.Change("numericBoxChanged"))
                   //                            .ToClientTemplate().ToHtmlString());
                   columns.Bound(c => c.IsActive).Hidden();
                   columns.Bound(c => c.Note).Hidden();
                   columns.Bound(c => c.UserDefined1).Hidden();
                   columns.Bound(c => c.UserDefined2).Hidden();
                   columns.Bound(c => c.UserDefined3).Hidden();
                   columns.Bound(c => c.UserDefined4).Hidden();
                   //columns.Bound(c => c.CreationUserName).Hidden();
                   //columns.Bound(c => c.CreationDate).Hidden().Format("{0:MM/dd/yyyy H:mm}");
                   //columns.Bound(c => c.LastUpdateUserName).Hidden();
                   //columns.Bound(c => c.LastUpdateDate).Hidden().Format("{0:MM/dd/yyyy H:mm}");
 
               })
              .ToolBar(toolbar =>
              {
                  toolbar.Save();
                  toolbar.Excel();
                  toolbar.Pdf();
              })
              .ColumnMenu()
              .Editable(editable => editable.Mode(GridEditMode.InCell))
          .HtmlAttributes(new { style = "height: 500px" })
              .Selectable(selectable =>
              {
                  selectable.Mode(GridSelectionMode.Single);
                  selectable.Type(GridSelectionType.Cell);
              })
              .Sortable(sortable =>
              {
                  sortable.SortMode(GridSortMode.SingleColumn);
              })
              .HtmlAttributes(new { style = "height: 500px" })
          .Events(ev => ev.DataBound("db"))
              .Filterable()
              .Scrollable()
             .DataSource(dataSource => dataSource
         .Ajax()
         .Model(model =>
         {
             model.Id(p => p.Id);
             model.Field(p => p.StudentId).Editable(false);
             model.Field(p => p.Name).Editable(false);
             model.Field(p => p.MarkStructureId).Editable().Editable(false);
 
         })
        .Read(read => read.Action("StudentMarks_Read2", "StudentMarks", Model))
         //.Update("StudentMark_Update", "StudentMarks")
         .Update(update => update.Action("StudentMark_Update", "StudentMarks"))
 
         )
    )
Georgi
Telerik team
 answered on 07 Aug 2018
3 answers
158 views

Hi everyone, I'm new in Kendo ASP.NET and I would like to see if some one could help me or give me an a guide. Rigth now I'm trying to implement an excel export of a pivotGrid. I already set all the pivotgrid configuration as in Razor as in the controller but when ran it I got the error (ScreenShot Attached).

The following is the configuration of the pivotGrid the View and Controller.

 

View:

@ModelType IEnumerable(Of TelerikMvcVB.HomeModel)

<link href="@Url.Content("~/Content/bootstrap.css")" rel="stylesheet" type="text/css" />

@* Content-box fixes as per http://docs.telerik.com/kendo-ui/third-party/using-kendo-with-twitter-bootstrap article  *@
<link href="@Url.Content("~/Content/box-sizing-fixes.css")" rel="stylesheet" type="text/css" />

<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

<link href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.common-bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/jszip.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/kendo.all.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/kendo.aspnetmvc.min.js"></script>
<script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
<script src="~/Scripts/kendo/jszip.min.js"></script>


<div>
    <div style="margin-top:-2%">
        <h2>Kendo PivotGrid - Razor</h2>
    </div>
    <button id="export" class="k-button k-button-icontext hidden-on-narrow"><span class="k-icon k-i-excel"></span>Exportar Excel</button>
    <div class="responsive-message"></div>

    <div>
        @(Html.Kendo().PivotConfigurator().Name("configurator") _
                    .HtmlAttributes(New With {.class = "hidden-on-narrow"}) _
                    .Filterable(True) _
                    .Sortable() _
                    .Height(570)
        )

        @(Html.Kendo().PivotGrid(Of HomeModel)() _
                            .Name("pivotgrid") _
                            .Excel(Function(excel) excel _
                                .FileName("PruebaExcelRazor.xlsx") _
                                .ForceProxy(Url.Action("Excel_Export_Save", "Home"))) _
                            .HtmlAttributes(New With {.class = "hidden-on-narrow"}) _
                            .Sortable() _
                            .Configurator("#configurator") _
                            .ColumnWidth(120) _
                            .Height(570) _
                            .BindTo(Model) _
                            .DataSource(Function(dataSource) dataSource _
                                .Ajax() _
                                .Schema(Function(schema) schema _
                                .Cube(Function(cube) cube _
                                    .Dimensions(Function(dimensions) _
                                    {
                                        dimensions.Add(Function(model) model._nombre).Caption("Nombre"),
                                        dimensions.Add(Function(model) model._idProductos).Caption("Id Producto"),
                                        dimensions.Add(Function(model) model._precio).Caption("Precio"),
                                        dimensions.Add(Function(model) model._cantidad).Caption("Cantidad")
                                    }) _
                                    .Measures(Function(measures) measures.Add("Contar Productos").Field(Function(model) model._idProducto).AggregateName("Count"))
                            ))))

        )

    </div>
</div>

@Scripts.Render("~/bundles/bootstrap")
@*@RenderSection("scripts", required:=False)*@

<style>
    #pivotgrid {
        display: inline-block;
        vertical-align: top;
        width: 70%;
    }

    #configurator {
        display: inline-block;
        vertical-align: top;
    }

    .hidden-on-narrow {
        display: inline-block;
        vertical-align: top;
    }
</style>

<script>
    $(function () {
        $("#export").click(function () {
            $("#pivotgrid").getKendoPivotGrid().saveAsExcel();
        });
    });

    function onError(e) {
        alert("error: " + kendo.stringify(e.errors[0]));
    }
</script>

 

Controller:

Imports System.Runtime.InteropServices
Imports System.Web
Imports Kendo.Mvc.Extensions
Imports Kendo.Mvc.UI


Public Class HomeController
    Inherits System.Web.Mvc.Controller

    Function Index() As ActionResult
        Dim DA As New DataAccess
        Dim lstProductos = DA.GetProductList()
        Return PartialView("~/Views/Home/Index.vbhtml", lstProductos)
    End Function

    <HttpGet>
    Function Excel_Export() As ActionResult
        Return View()
    End Function


    <HttpPost>
    Function Excel_Export_Save(ByVal contentType As String, ByVal base64 As String, ByVal fileName As String) As ActionResult
        Try
            Dim fileContents = Convert.FromBase64String(base64)
            Return File(fileContents, contentType, fileName)
        Catch ex As Exception

        End Try
    End Function


    Function ListGetData() As ActionResult
        Try
            Dim DA As New DataAccess
            Dim lstProductos = DA.GetProductList()
            Return View("~/Views/Home/Index.vbhtml", lstProductos)
            'Return lstProductos
        Catch ex As Exception
            ' Return HttpStatusCodeResult(400, "")
        End Try
    End Function
End Class

Thanks for any help about the error..I made the code from the example of the web page from the remote binding

 

 

 

Boyan Dimitrov
Telerik team
 answered on 07 Aug 2018
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
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?