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

Hi again,
after some initial testing, we have found some formulae related issues.

1) first is about "shared" formulae formulae" (ie the ones obtained by dragging one formula over adjacent cells).
I'll attach you two simple xlsx file, both work exactly the same in MS Excel, but one doesn't work fine in Spreadsheet component.

Compare the first section of the two files: the row tagged as "Cumulative" doesn't work in Spreadsheet in the second version, since the "shared" sum formula doesn't work. 

NOTE: the first version is produced with MS Excel, the other with a famous third party commercial XLS library.

2) empty cells are not considered as "0", and give an error when used as parameters in formulae (see second section of any of the attached file, compared to first section) the yellow empty cell gives an error

 

3) SUMPRODUCT doesn't work. It's sufficient to test it on one of your online examples to verify. It throws an error

thanks and regards,
Sebastian

Mihai
Telerik team
 answered on 08 Feb 2016
3 answers
144 views

Hi there,

I believe I have found a bug with the PDF export on the grid in Q2 2015 and onwards. I have reproduced this bug using the VS2015 PDF Export demo  supplied with the Kendo install.

In order to replicate this bug, please enable bundling optimizations in the BundleConfig class:

 

BundleTable.EnableOptimizations = true;

 

Grid export to PDF will no longer work - it will fail with an error about the font:

"Cannot load font from http://localhost/Content/kendo/fonts/DejaVu/DejaVuSans-Bold.ttf?v=1.1"

It would seem that the path is working from the kendo folder and excluding the version number? The actual path to the font file should be:

"http://localhost/Content/kendo/2015.2.624/fonts/DejaVu/DejaVuSans-Bold.ttf"

The export works without issue when optimizations are disabled.

Regards,

 

Paul McKay

 

Daniel
Telerik team
 answered on 08 Feb 2016
2 answers
519 views

Hi,

I am trying to access the grid column in detail template and it's gives me invalid template.

The code look's like

@(Html.Kendo().Grid<MessageViewModel>()
              .Name("messageGrid")
              .Columns(columns =>
              {
                  columns.Bound(e => e.MessageName);
                  columns.Bound(e => e.MessageSentTime);
                  columns.Bound(e => e.Message).Visible(false);
              })
              .Sortable()
              .Pageable()
              .Scrollable()
              .Groupable()
              .ClientDetailTemplateId("template")
              .HtmlAttributes(new {style = "height:550px;"})
              .DataSource(dataSource => dataSource
                  .Ajax()
                  .PageSize(25)
                  .Read(read => read.Action("GetMessageGridData", "Home").Data("getGridData"))
              ))
        <script id="template" type="text/kendo-tmpl">
            @(Html.Kendo().PanelBar()
                          .Name("Panel_#:Id#") // this id is from parent grid.
                          .Items(panelbar =>
                          {
                              panelbar.Add().Text("#:MessageName#")
                                  .Expanded(false)
                                  .Content("<pre>" + @Html.Raw(Html.Encode("#:Message#")) + "</pre>");
                          }).ToClientTemplate()
                  )

        </script>

 

Please help me.

 

Sundeep Kumar
Top achievements
Rank 1
 answered on 05 Feb 2016
3 answers
412 views

Hi,

 

I need to call scheduler's navigate function when I click Search button. How can I do that?

I wrote the following code for refreshing the scheduler but it sometimes works and sometimes not.

$("#gridJobAllocation").data("kendoGrid").dataSource.read();

 

 Thanks.

Vladimir Iliev
Telerik team
 answered on 05 Feb 2016
1 answer
1.2K+ views

I'm trying to figure out how to have one of my fields data validated through my controller on a popup edit via the grid by GridEditMode.Popup.

Here's how my grid is set up:

 

@(Html.Kendo().Grid(Model)
.Name("areasGrid")
.Columns(c =>
{
    c.Bound(p => p.Id).Title("ID").Visible(false);
    c.Bound(p => p.AreaName).Title("Area");
    c.Bound(p => p.SupervisorPic).Title("User").Visible(false);
    c.Bound(p => p.SupervisorName).Title("Supervisor");
    c.Command(command => { command.Edit(); command.Destroy(); }).Width(170);
})
.AllowCopy(true)
.Selectable()
.DataSource(dataSource => dataSource
    .Ajax()
    .ServerOperation(false)
    .Model(model =>
    {
        model.Id(p => p.Id);
    })
    .PageSize(30)
    .Events(events => events.Error("error_handler"))
    .Create(update => update.Action("EditingPopup_Create", "ProgramAssignment"))
    .Read(read => read.Action("EditingPopup_Read", "ProgramAssignment"))
    .Update(update => update.Action("EditingPopup_Update", "ProgramAssignment"))
    .Destroy(update => update.Action("EditingPopup_Destroy", "ProgramAssignment"))
)
.Sortable()
.Filterable()
.ToolBar(toolbar =>
{
    toolbar.Create();
})
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("Area").Window(w => w.Width(400)).CreateAt(GridInsertRowPosition.Bottom))
.Pageable(p => p.PageSizes(new int[] { 10, 20, 30, 50 }))
.Resizable(resize => resize.Columns(false))
.ColumnMenu()
)

And here's my template where users can add/edit records that's used by the grid's editable template name:

@model Voice.ViewModels.AreaViewModel
 
<link href="~/Content/kendo/2015.3.1111/kendo.blueopal.min.css" rel="stylesheet" type="text/css" />
@(Html.Kendo().TextBoxFor(model => model.Id)
    .Name("Id")
    .HtmlAttributes(
        new
        {
            @style = "display:none"
        }
    )
)
<table>
    <tr>
        <td>
            <label>Area</label>
        </td>
        <td>
            @(Html.Kendo().TextBoxFor(model => model.AreaName)
                .Name("AreaName")
                .HtmlAttributes(
                    new
                    {
                        @style = "width: 255px",
                        @placeholder = "Area Name",
                        @id = "AreaName",
                        @class = "k-textbox",
                        @required = "required",
                        @validationmessage = "Enter area name.",
                        @maxlength = "255"
                    }
                )
            )
        </td>
    </tr>
    <tr>
        <td>
            <label>Supervisor</label>
        </td>
        <td>
            @(Html.Kendo().TextBoxFor(model => model.SupervisorPic)
                .Name("SupervisorPic")
                .HtmlAttributes(
                    new
                    {
                        @style = "width: 255px",
                        @placeholder = "Supervisor PIC",
                        @id = "SupervisorPic",
                        @class = "k-textbox",
                        @required = "required",
                        @validationmessage = "Enter the PIC code of the supervisor.",
                        @maxlength = "3"
                    }
                )
            )
        </td>
    </tr>
</table>

Ideally, I'd like to be able to validate the SupervisorPic field (basically someone's user ID at my work) by calling a method in my controller to validate the entry against our security system.  Is this possible?

Vasil
Telerik team
 answered on 04 Feb 2016
1 answer
96 views

Hello,

Is it possible to combine virtualization and MVVM in a ComboBox?

Because I'm trying to do it and it doesn't work.

If yes can you send me the link to an example, because I've been searching and I didn't find any.

Thank you,

Olido.

Georgi Krustev
Telerik team
 answered on 04 Feb 2016
1 answer
270 views

Hi, I have been receiving the error  "0x800a138f - JavaScript runtime error: Unable to get property 'show' of undefined or null reference". I've looked over my code and examined my javascript function, but I have been unable to find any errors. Why would the .show error out on me?


My Code looks as follows:

@(Html.Kendo().Notification()
    .Name("#popupNotification")
    .Width("100%")
    .Position(p => p.Pinned(true).Top(30).Right(30))
    .Stacking(NotificationStackingSettings.Down)
    .AutoHideAfter(7000)
    .Templates(t =>
            {
               t.Add().Type("info").ClientTemplateID("popupTemplate");
            })
)

<button id="showNotification" class="k-button">Notification</button><br />

 

<script id="popupTemplate" type="text/x-kendo-template">
    <div class="">
        <h3>#= title #</h3>
        <p>#= message #</p>
    </div>
</script>

<script>
    $(document).ready(function() {
        var popupNotification = $("#popupNotification").data("kendoNotification");

        $("#showNotification").click(function() {
            popupNotification.show ({
                title: "New Notification",
                message: "Test"
            }, "info");
        });
    });
</script>

Misho
Telerik team
 answered on 04 Feb 2016
7 answers
311 views
So the gantt chart has Day, Week, and Month views.... but are there any plans to include a Year view? I'd like to have a Year view with Months as the sub-divider.

Thanks!
Bozhidar
Telerik team
 answered on 04 Feb 2016
5 answers
280 views

I have a Grid with a detail template to show another records related to the main data set. I'm trying to export everyting to excel but when i export it excel says "Excel found unreadable content" if i make the function to return an empty list to the export function the excel file has no problem it shows nothing about details but columns names. but if i return the dataset that i need the message of unreadable content is shown.

i've followed the example http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/how-to/excel/detail-grid-export  and http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/excel/detail-grid-export so the functions are practically the same

 

var detailExportPromises = [];

        var dataSource = new kendo.data.DataSource({
            type: "aspnetmvc-ajax",
            transport: {
                read: "@Url.Action("Fracciones_Read", "Home")",
                type: "POST"
            },
            schema: {
                data: "Data",
                total: "Total",
                error: "Errors"
            }
        });

        dataSource.read();

        function dataBound() {
            detailExportPromises = [];
            this.expandRow(this.tbody.find("tr.k-master-row").first());
        }
        function parameters() {
            return {
                fechaIni: $("#fechaIni").data("kendoDatePicker").value(),
                fechaFin: $("#fechaFin").data("kendoDatePicker").value(),
                operacion: "Imp"
            }
        }

        function fracciones_excelExport(e) {
            e.preventDefault();
        }

        function excelExport(e) {
            e.preventDefault();

            var workbook = e.workbook;

            detailExportPromises = [];

            var masterData = e.data;

            for (var rowIndex = 0; rowIndex < masterData.length; rowIndex++) {
                exportChildData(masterData[rowIndex].NumeroPedimento, rowIndex);
            }

            // wait for all detail grids to finish exporting
            $.when.apply(null, detailExportPromises)
            .then(function () {
                // get the export results
                var detailExports = $.makeArray(arguments);

                // sort by masterRowIndex
                detailExports.sort(function (a, b) {
                    return a.masterRowIndex - b.masterRowIndex;
                });

                // add an empty column
                workbook.sheets[0].columns.unshift({ width: 30 });

                // prepend an empty cell to each row
                for (var i = 0; i < workbook.sheets[0].rows.length; i++) {
                    workbook.sheets[0].rows[i].cells.unshift({});
                }

                // merge the detail export sheet rows with the master sheet rows
                // loop backwards so the masterRowIndex doesn't need to be updated
                for (var i = detailExports.length - 1; i >= 0; i--) {
                    var masterRowIndex = detailExports[i].masterRowIndex + 1;

                    var sheet = detailExports[i].sheet;

                    // prepend an empty cell to each row
                    for (var ci = 0; ci < sheet.rows.length; ci++) {
                        if (sheet.rows[ci].cells[0].value) {
                            sheet.rows[ci].cells.unshift({});
                        }
                    }

                    // insert the detail sheet rows after the master row
                    [].splice.apply(workbook.sheets[0].rows, [masterRowIndex + 1, 0].concat(sheet.rows));
                }

                // save the workbook
                kendo.saveAs({
                    dataURI: new kendo.ooxml.Workbook(workbook).toDataURL(),
                    fileName: "Importaciones.xlsx"
                });
            });
        }

        function exportChildData(NumeroPedimento, rowIndex) {
            var deferred = $.Deferred();

            detailExportPromises.push(deferred);

            var rows = [{
                cells: [
                    { value: "DescripcionFactura" },
                    { value: "DescripcionPedimento" },
                    { value: "Arancel" }
                ]
            }];

            dataSource.filter({ field: "NumeroPedimento", operator: "eq", value: NumeroPedimento });

            var exporter = new kendo.ExcelExporter({
                columns: [
                    { field: "DescripcionFactura" },
                    { field: "DescripcionPedimento" },
                    { field: "Arancel" }
                ],
                dataSource: dataSource
            });

            exporter.workbook().then(function (book, data) {
                deferred.resolve({
                    masterRowIndex: rowIndex,
                    sheet: book.sheets[0]
                });
            });
        }
    </script>

 

Kostadin
Telerik team
 answered on 04 Feb 2016
4 answers
1.0K+ views
Hi, is there a direct way to turn off autocomplete on filter without having to use some sort template?  The hack work-around I'm playing around with at the moment is setting MinLength to a unrealistic amount so the autocomplete never fires off.

columns.Bound(m => m.UserName).Title("User Name").Width(115).Filterable(f => f.Cell(c => c.Operator("contains").ShowOperators(false).MinLength(5000)));
Alexander Popov
Telerik team
 answered on 04 Feb 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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?