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

Does anyone know how to Group by resource and date in the week view in MVC such as in this example in the ajax version?

http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourcegrouping/defaultcs.aspx

if you set in the example GroupBy="Date, Speaker" the group will be by date and the speakers under each date.

 

I have tried to do something similar in the MVC version but not able to get the same behaviour

.Group(group => group.Resources("Date, EmployeeID")) - Failed

.Group(group => group.Resources("Date").Resources("EmployeeID")) - Failed

 

 

 

Vladimir Iliev
Telerik team
 answered on 26 Feb 2016
4 answers
245 views

Is it possible to get some or all of the values from subsequent pages in the grid?

For example:

The user is on page one or three. I would like to get all of the values for a particular column from the grid. Even those values not shown in the grid (pages 2 & 3).

Greg
Top achievements
Rank 1
 answered on 25 Feb 2016
3 answers
578 views

Using the Kendo Editor's FileBrowser is there any way to insert a link to a file who's <a> tag (anchor tag) has the attribute target="_blank", i.e. the link to the file opens in a new tab. I know this could be manually added to the inserted link through the "ViewHtml" button however my client is not tech savvy and this option is not a desired solution.

Below is an example of the current and desired outcome upon inserting a file using the FileBrowser.

Current outcome:
<a href="/Files/SomeFile.pdf">File</a>

Desired outcome:

<a href="/Files/SomeFile.pdf" target="_blank">File</a>


Stanimir
Telerik team
 answered on 25 Feb 2016
1 answer
81 views

I need to prevent some users from modifying current occurrence of recurring appointment. I've built scheduler_edit function but now adding new appointments is also disabled. How to distinguish between them? I've also tried using e.event.isNew() but it didn't work because event is new in both current occurrence and adding new appointment.

Plamen
Telerik team
 answered on 25 Feb 2016
2 answers
417 views

I'm testing the grid for an almost certain purchase, and I've tried to export it to both PDF and XLS. With Excel it was almost straight forward, but when I try to follow the steps presented on the demo (http://demos.telerik.com/aspnet-mvc/Beta/grid/pdf-export) it does not work. When I click on the export button, the progress bar loads and when it finishes nothing happens, the action never gets to be executed.

This is my view:

@model IEnumerable<ViewModels.TestViewModel>

@{
    ViewBag.Title = "Tests KendoUI";
}

<script src="~/Scripts/lib/jszip.min.js" type="text/javascript"></script>
<script src="~/Scripts/lib/pako.min.js" type="text/javascript"></script>

<style>
    /*
                Use the DejaVu Sans font for display and embedding in the PDF file.
                The standard PDF fonts have no support for Unicode characters.
            */
    .k-grid {
        font-family: "DejaVu Sans", "Arial", sans-serif;
    }

    /* Hide the Grid header and pager during export */
    .k-pdf-export .k-grid-toolbar,
    .k-pdf-export .k-pager-wrap,
    .k-pdf-export a.k-button.k-button-icontext,
    .k-pdf-export .k-filter-row,
    .k-pdf-export .k-grouping-header,
    .k-pdf-export .k-grid tr td:last-child {
        display: none !important;
    }
</style>

@(Html.Kendo().Grid(Model)
      .Name("grid")
      .DataSource(dataSource => dataSource
          .Ajax()
          .Read(read => read.Action("Products_Read", "Home"))
          .Aggregates(aggregates => aggregates.Add(p => p.oper_monto).Sum())
          )
      .Columns(columns =>
      {
        columns.Bound(p => p.oper_numero).Hidden(true);
        columns.Bound(p => p.oper_monto).ClientFooterTemplate("Total: #=sum#");
        columns.Bound(p => p.cpto_codigo);
      })
      .Excel(excel => excel
        .FileName("Reporte.xlsx")
        .Filterable(true)
        .AllPages(true)
        .ProxyURL(Url.Action("Excel_Export_Save", "Home"))
      )
      .Pdf(pdf => pdf
            .AllPages()
            .FileName("Reporte.pdf")
            .ProxyURL(Url.Action("Pdf_Export_Save", "Home"))
        )
      .ColumnMenu()
      .ToolBar(t => t.Excel().Text("Exportar a Excel"))
      .ToolBar(t => t.Pdf().Text("Exportar a PDF"))
      .ToolBar(toolBar => 
                    toolBar.Custom()
                        .Text("Guardar Preferencias")
                        .HtmlAttributes(new { id = "save" })
      )
      .ToolBar(toolBar =>
                    toolBar.Custom()
                        .Text("Cargar Preferencias")
                        .HtmlAttributes(new { id = "load" })
      )                      
      .Filterable(ftb => ftb.Mode(GridFilterMode.Menu))
)

<script>

    $(function () {
        var grid = $("#grid").data("kendoGrid");

        $("#save").click(function (e) {
            e.preventDefault();
            localStorage["kendo-grid-options"] = kendo.stringify(grid.getOptions());
        });

        $("#load").click(function (e) {
            e.preventDefault();
            var options = localStorage["kendo-grid-options"];
            if (options) {
                grid.setOptions(JSON.parse(options));
            }
        });
    });
</script>

And this is my controller action:

[HttpPost]
        public ActionResult Pdf_Export_Save(string contentType, string base64, string fileName)
        {
            var fileContents = Convert.FromBase64String(base64);

            return File(fileContents, contentType, fileName);
        }

 

Thanks in advance.

Dimiter Madjarov
Telerik team
 answered on 24 Feb 2016
3 answers
148 views

Hi,

I'm currently using a custom timeline view on my scheduler as my only view.
In this particular case the "business hours" button isn't really relevant.
How would one go about hiding this button as elegantly as possible?

Many thanks in advance.

Pavlos
Top achievements
Rank 1
 answered on 24 Feb 2016
2 answers
99 views

Hi,

 

I'd like to edit a child collection of entities in a Grid with local data and inline edit. Is this possible?

I tried it and it doesn't work.

Thanks

Sven

Sven
Top achievements
Rank 1
 answered on 24 Feb 2016
3 answers
217 views

Hi,

I have 2 tiers of Kendo Grids. They are defined as:

1st tier grid:

            <% Html.Kendo().Grid<EvaluationsSummaryGridViewModel>()
                .Name("EvaluationGrid")
                .TableHtmlAttributes(new { style = "font-size:8pt;" })
                .HtmlAttributes(new { style = "height:415px;width:1100px" })
                .DataSource(dataSource => dataSource
                        .Ajax()
                        .Model(model => model.Id(a => a.EvaluationId))
                        .ServerOperation(true)
                        .Events(e => e.RequestEnd("onEvaluationSummaryRequestEnd"))
                        .Read(read => read.Action("GetEvaluationSummaryAjax", "Evaluations", new { yearId = ViewData["YearId"], evaluationVersionId = ViewData["EvaluationVersionId"] }))
                        .PageSize(15)
                    )
                .Editable(e => e.Mode(Kendo.Mvc.UI.GridEditMode.InLine).Enabled(true))
                .ClientDetailTemplateId("EvaluationOverallQuestionTemplate")
...

%>

2nd tier grid:

    <script id="EvaluationOverallQuestionTemplate" type="text/x-kendo-template">
        <%: Html.Kendo().Grid<EvaluationsSummaryOverallQuestionsGridViewModel>()
            .Name("EvaluationGrid_#=EvaluationId#")
            .TableHtmlAttributes(new { style = "font-size:8pt;" })
            .HtmlAttributes(new { style = "height:320px;width:950px" })
            .DataSource(dataSource => dataSource
                    .Ajax()
                    .Model(model => model.Id(a => a.EvaluationQuestionId))
                    .ServerOperation(false)
                    .Events(a => a.RequestEnd("onEvaluationsSummaryOverallQuestionsGridRequestEnd"))
                    .Read(read => read.Action("EvaluationsSummaryOverallQuestionsAjax", "Evaluations", new { evaluationId ="#=EvaluationId#" }))
                )
            .Pageable(pager => pager.Input(true)
                                    .Refresh(true)
                                    .PageSizes(new[] { 10, 20, 30 })
                    )
            .Editable(e => e.Mode(Kendo.Mvc.UI.GridEditMode.InLine).Enabled(true))
            .Scrollable(scrolling => scrolling.Height(300))
            .Resizable(resize => resize.Columns(true))
            .Sortable()
            .Filterable()
            .Columns(columns =>
            {
                columns.Bound(b => b.EvalutionMasterPillarId)
                    .Width(100);
                columns.Bound(b => b.VersionQuestion)
                    .Width(300);
                columns.Bound(b => b.HPAAssessment)
                    .Width(300);
                columns.Bound(e => e.EvaluationStatusInitial)
                    .ClientTemplate("<div class='sprite sprite-StopLight_#=EvaluationStatusInitial#'></div>")
                    .Filterable(false)
                    .Sortable(false)
                    .HtmlAttributes(new { style = "text-align:center" })
                    .Width(100);
                columns.Bound(e => e.EvaluationStatusCurrent)
                    .ClientTemplate("<div class='sprite sprite-StopLight_#=EvaluationStatusCurrent#'></div>")
                    .Filterable(false)
                    .Sortable(false)
                    .HtmlAttributes(new { style = "text-align:center" })
                    .Width(100);
           })
           .ToClientTemplate()         
        %>
    </script>

The problem is that while 1st tier grid is working fine, 2nd tier grid can not be opened when clicking on the arrow on each row of 1st grid. The reason is ClientTemplate("<div class='sprite sprite-StopLight_#=EvaluationStatusInitial#'></div>"), which is supposed to display different icons based on the value of "EvaluationStatusInitial". I need help on how to make it work. Thanks.

 

Maria Ilieva
Telerik team
 answered on 24 Feb 2016
1 answer
139 views

Hi,

We upgraded the jQuery version to jquery-1.12.0.js on our site, and now we are noticing issues with the dropdown alignment, in Firefox and IE11. To investigate we checked the demo page, and noticed it is still using jquery-1.11.1.js. Any help, suggestions?

 

Demo: http://demos.telerik.com/aspnet-ajax/editor/examples/custommodules/defaultcs.aspx

 

Thanks.

Alex Gyoshev
Telerik team
 answered on 24 Feb 2016
1 answer
179 views

I have two dropdown at layout screen which can be use by more than one view.

My first view contain layout screen(with cascading dropdown) and scheduler control.

1.On Page load ,both cascading dropdown should populate with default value with scheduler calendar.

2.Scheduler control should load based on cascading dropdown selection change.

Issue#1 : My second dropdown is not loading and it is disable.

issue#2 : Scheduler control loading before layout dropdowns call. 

Layout view :

@(Html.Kendo().DropDownList()
                      .Name("Facility")
              .HtmlAttributes(new { style = "width:100%" })
                      .DataTextField("FacilityName")
                      .DataValueField("FacilityId")
              .DataSource(source =>
              {
                  source.Read(read =>
                  {
                      read.Action("GetFacilityList", "Facility");
                  });
              })
)

cascading dropdown:

@(Html.Kendo().DropDownList()
              .Name("Location")
              .HtmlAttributes(new { style = "width:100%" })
                      .DataTextField("LocationName")
                      .DataValueField("LocationId")
                      .DataSource(source =>
              {
                  source.Read(read =>
                  {
                      read.Action("GetFacilityLocationsList", "Facility")
                          .Data("filterLocations")
                       .Type(HttpVerbs.Post);
                  })
                  .ServerFiltering(false);
              })
              .Enable(true)
              .AutoBind(true)
                      .CascadeFrom("Facility")
                                )
                                <script>
                                    function filterLocations() {
                                        alert("filter");
                                        return {
                                            facilityId: $("#Facility").val()
                                        };
                                    }

 

Sceduler partial view:
 @(Html.Kendo().Scheduler<ORSA.ViewModel.ScheduleViewModel>()
          .Name("scheduler")
          .Date(DateTime.Today)
                  .StartTime(6, 00, 00)
                  .EndTime(23, 00, 00)
          .Height(800)
          .Views(views =>
          {
              views.WeekView(weekView => weekView.Selected(true));

          })
                  .Editable(editable =>
                  {
                      editable.TemplateName("CreateCase");
                  })
          .Timezone("Etc/UTC")
          .Group(group => group.Resources("Rooms"))
          .Resources(resource =>
          {
              resource.Add(m => m.Room.RoomId)
                  .Title("Rooms")
                  .Name("Rooms")
                  .DataTextField("RoomCode")
                  .DataValueField("RoomId")
                  .BindTo(Model.RoomList);
          })
              .DataSource(d => d.Read("DisplayBlocks", "Schedule"))

    )

Georgi Krustev
Telerik team
 answered on 24 Feb 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?