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

Hi,

I am uploading an excel file that has some formulas in them to the kendo spreadsheet. The sheet seems to be loading in the Spreadsheet fine, but when I try to send the retrieved values from the kendo spreadsheet, there seems to be an exception - 'TypeError: this is undefined'

function fetchDataForKidsGridModel(ExcelVals) {
    debugger;
    var cellValues, range, ArrOfCellValue = [], CellValueArr,
    startPoint = 17,
    mandotoryColumn = "E";
 
    var outletArr = [];
 
    var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
    var sheet = spreadsheet.activeSheet();
    var endPoint = getSheetLength(sheet, startPoint, mandotoryColumn
    for (var l = 0; l < endPoint ; l++) {
 
        var StartColumn_CI = 85;
        CellValueArr = [];
        var arrOfOutlets = [];
        for (var i = 0; i < ExcelVals.length ; i++) {
 
            var rowCellNo = ExcelVals[i].ColumnVal.replace("#", startPoint).trim();
            range = sheet.range(rowCellNo)
            cellValues = range.values();
            if (cellValues[0][0] == null) {
                cellValues[0][0] = "";
            }
            CellValueArr[i] = cellValues;
        }
        ArrOfCellValue[l] = CellValueArr;
 
        startPoint++;
    }
    //ERROR is thrown at this point while debugging
    $.ajax({
        url: '/UploadPO/CreateModelForGridEcomm',
        type: 'POST',
        async: true,
        dataType: 'json',
 
        data: { cellValues: ArrOfCellValue, BrandID: brandName }, //
 
        success:
            function (result) {
                console.log(result);
                // you code comes here
                GetGrid(result)
            },
        error:
    function (result) {
        //Error Handling
        if (result.success = true) {
            alert(result.responseText);
        }
        if (result.success = false) {
            alert(result.responseText);
        }
    }
    });
}

Any help would be much appreciated.

Feel free to ask any questions to further clarify my question..

Thanks in advance...

Alex Gyoshev
Telerik team
 answered on 15 Apr 2016
1 answer
8.3K+ views
I have a grid with databound method which shows the message 'No Data Found for the search' in case no data gets retrieved after performing search. Now i have added a radio buttons which when clicked needs to clear the old data from the grid. The issue is i am using the code
$(grid).data("kendoGrid").dataSource.data([]);

 which does clear the grid but it also shows 'No Data Found for the search' message. Since user didn't perform any search but only changed the radio button it doesn't seem right to display that message in the grid. So, i was wondering if there was a way to clear the grid without invoking the databound method.

Thanks.

Dimiter Madjarov
Telerik team
 answered on 15 Apr 2016
3 answers
126 views

Hi 

I tried to use client hierarchy method, first level 'Region Level' and second level "state level". while click region level state level grid bind is happening, but state level details row values are not taken while create client template. why?. please see the code below and let me know where is the problem.

for example child details are 

state   Total Request   Req_sent yes    Red_send No   +ive%  -ive%     Request Sent progress bar

AL           18                      11                       7                    20      80        ActionLink1(20% green) Value 11 | ActionLink2(80% red) Value 7

But only parent grid values are taken. please see the below code and point me where is the problem? how to create action link with progress bar style.

@(Html.Kendo().Grid<VAMDEScheduler.Models.RegionModel>()
            .Name("Regiongrid")
            .Columns(columns =>
            {
                columns.Bound(r => r.Region).Width(200);
                columns.Bound(r => r.TotalRequest).Width(100);
                columns.Bound(r => r.ReqSend_Yes).Width(50);
                columns.Bound(r => r.ReqSend_No).Width(50);
                columns.Bound(r => r.ReqSend_YesP).Width(50).Title("+ive %");
                columns.Bound(r => r.ReqSend_NoP).Width(50).Title("-ive %");
                columns.Template(@<text></text>).ClientTemplate("<div class='progress' style='height:25px'><a href='/sample1?Category=REQUESTSENT_YES&Region=#=Region#' class='progress-bar progress-bar-success' style='width:#=ReqSend_YesP#%;'><span>#=ReqSend_Yes#</span></a><a href='/sample1?Category=REQUESTSENT_NO&Region=#=Region#' class='progress-bar progress-bar-danger' style='width:#=ReqSend_NoP#%;'><span>#=ReqSend_No#</span></a></div>").Title("Request Sent").Width(100);

            }) //columns
                            .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("Region_Read", "Home")))
                            .ClientDetailTemplateId("State_Read_template")
            )

 

<script id="State_Read_template" type="text/x-kendo-template">
                @(Html.Kendo().Grid<VAMDEScheduler.Models.StateModel>()
                .Name("stategrid") // make sure the Name is unuque
                .Columns(columns =>
                    {
                        columns.Bound(r => r.State).Width(195);
                        columns.Bound(r => r.TotalRequest).Width(100);
                        columns.Bound(r => r.ReqSend_Yes).Width(50);
                        columns.Bound(r => r.ReqSend_No).Width(50);
                        columns.Bound(r => r.ReqSend_YesP).Width(50).Title("+ive %");
                        columns.Bound(r => r.ReqSend_NoP).Width(50).Title("-ive %");
                        columns.Template(@<text></text>).ClientTemplate("<div class='progress' style='height:25px'><a href='/sample1?Category=REQUESTSENT_YES&State=#=Region#' class='progress-bar progress-bar-success' style='width:#=ReqSend_YesP#%;'><span>#=ReqSend_Yes#</span></a><a href='/sample2/#=ReqSend_No#' class='progress-bar progress-bar-danger' style='width:#=ReqSend_NoP#%;'><span>#=ReqSend_No#</span></a></div>").Title("Request Sent").Width(100);
                   
                })
                            .DataSource(dataSource =>
                                // Make request to Products_Read and provide the current CategoryID as a route parameter
                                  dataSource.Ajax().Read(read => read.Action("State_Read", "Home", new { region = "#=Region#" }))
                                )
                            .Pageable()
                            .ToClientTemplate()
                )
            </script>

Dimiter Madjarov
Telerik team
 answered on 14 Apr 2016
4 answers
137 views

It seems that the more grids and/or rows I add to a page the more issues I have with dropdowns being off center (see attached)

 

Is this a known issue or has it been encountered by anyone else?

 

Alex
Top achievements
Rank 1
 answered on 14 Apr 2016
1 answer
933 views

How would I go about adding multi-select functionality to a custom filter?

columns.Bound(c => c.InventoryStatus).Title("Inventory Status").Filterable(filterable => filterable.UI("inventoryStatusFilter"));

function inventoryStatusFilter(element) {
    element.kendoDropDownList({
        dataSource: {
            transport: {
                read: "@Url.Action("FilterMenuCustomization_InventoryStatus")"
            }
        }
    });
}

Thanks in advance!

Steve.

 

 

Dimiter Topalov
Telerik team
 answered on 14 Apr 2016
7 answers
758 views
Hi,

I am using the following css rule to set popup window width. I got it from support thread.

div.k-edit-form-container {
    width: auto;
}
 
    div.k-edit-form-container div.editor-field textarea, input.k-textbox {
        width: 100%;
        max-width: none;
    }

But still layout is not rendered properly. I am using bootstrap "form-control" class.

Thanks in advance.
Dimo
Telerik team
 answered on 14 Apr 2016
1 answer
233 views
We have a layout that requires column headers which sit under other column headers. Since each child column has a numeric value we would like to put a total under the parent value that is the total of the children values. Is there a way to insert the total value of all childrent columns with a hierarchy dropdown or with a row before the child value?


Code looks like this:
@(Html.Kendo().Grid<DST.Areas.WSDashboard.Models.CustomWidgetsModel.GridViewModel>()
        .Name("Grid")
            .HtmlAttributes(new { style = "height: 450px;" })
        .Scrollable(s => s.Height("100%"))
        .Sortable()
        .Resizable(resizable => resizable.Columns(true))
        .Pageable(pageable => pageable
            .Refresh(true)
            .Enabled(true)
            .Messages(msg => msg.Display("{0:n0} - {1:n0} of {2:n0} items"))
            .PageSizes(true))
        .Navigatable()
        .Columns(columns =>
        {
        columns.Bound(p => p.KPP).Title("KPP").Width(100);
              
        columns.Bound(p => p.SystReqValue).Title("System Requirement").Width(150);
              
        columns.Group(group => group.Title("G Sub-Systems")
            .Columns(sub => {               
                sub.Group(sub1 => sub1.Title("F System")
                   
                    .Columns(fs =>
                    {
                        fs.Bound(p => p.RValue).Title("R").Width(100);
                        fs.Bound(p => p.GValue).Title("G").Width(100);
                        fs.Bound(p => p.BValue).Title("B").Width(100);
                    }));

                sub.Group(sub2 => sub2.Title("G System")
                    .Columns(gs =>
                    {
                        gs.Bound(p => p.WValue).Title("W").Width(100);
                        gs.Bound(p => p.LSystemValue).Title("L Systems").Width(100);
                    }));
            }));
              


          })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(15)
            .Read(read => read.Action("GetData", "Widgets", new RouteValueDictionary { { "area", "WSDashboard" } }))
        )
    ) 
Konstantin Dikov
Telerik team
 answered on 13 Apr 2016
1 answer
143 views

Does the editor provide any option to disable the HTML cleanup on paste or on "insertHtml"-command.
I want to allow our customers to create "incomplete" html snippets with the editor. For example our customers paste a html code like:

<tr><td>some text</td></tr>

Now the editor will removes the incorrect html and the result will be "some text" and the html markup gets lost.

Niko
Telerik team
 answered on 13 Apr 2016
1 answer
347 views

Dear Admin,

I got unorder arabic text format while export grid data to pdf. and i used  font-family: Tahoma for grid text font , it is displayed correct arabic format in grid but while export to pdf it result some unorder arabic text format.And example screenshots are attached below.Please kindly suggest.

Thanks & Regard

Rama Krishna

Daniel
Telerik team
 answered on 13 Apr 2016
3 answers
347 views

Using the MVC KendoGrid I've created a grid with custom filtering on some columns. Following the demo at http://demos.telerik.com/aspnet-mvc/grid/persist-state, I added code to save and load the state. I find that after saving then loading, I've lost the custom filters. Comparing the options object when saving and then when loading confirms this:

Column 0 when saving:

columns:Array[41]
  0:Object
    encoded:true
    field:"ShippingUnit"
    filterable:Object
      ui:shippingUnitFilter(element)
      __proto__:Object

Column 0 when loading:

columns:Array[41]
  0:Object
    encoded:true
    field:"ShippingUnit"
    filterable:Object
      __proto__:Object

Notice the ui element is missing on the load. Upon further research, I found it's the stringify function during save that drops the ui: element Any workarounds? Any examples of where this works? 

Here's the code:

@model Panther.Portal.Areas.Inventory.Models.InventoryVM
@{ViewBag.Title = "Inventory";}
@using Kendo.Mvc.UI
 
<link href="~/Content/kendo/2016.1.226/kendo.default.min.css" rel="stylesheet" />
<link href="~/Content/kendo/2016.1.226/kendo.common.min.css" rel="stylesheet" />
 
 
 
@section Scripts {
    <script src="~/Scripts/kendo/2016.1.226/kendo.all.min.js"></script>
    <script src="~/Scripts/kendo/2016.1.226/kendo.aspnetmvc.min.js"></script>
    <script src="~/Scripts/kendo/2016.1.226/kendo.grid.min.js"></script>
    <script src="~/Scripts/kendo/2016.1.226/kendo.all.min.js"></script>
}
 
 
<div class="box wide">
    <a href="#" class="k-button" id="save">Save State</a>
    <a href="#" class="k-button" id="load">Load State</a>
</div>
 
<div id="KendoGrid">
    @(Html.Kendo().Grid(Model.InventoryList)
        .Name("grid")
        //.ColumnMenu()
        .Columns(columns =>
        {
            columns.Bound(c => c.ShippingUnit).Title("Shipping Unit").Filterable(filterable => filterable.UI("shippingUnitFilter"));
            columns.Bound(c => c.InventoryStatus).Title("Inventory Status").Filterable(filterable => filterable.UI("inventoryStatusFilter"));
            columns.Bound(c => c.ProductId).Title("Product ID").Filterable(filterable => filterable.UI("productIDFilter"));
            //More Columns...
        })
        .Resizable(resize => resize.Columns(true))
        .Reorderable(reorder => reorder.Columns(true))
        .Sortable()
        .Selectable(selectable => selectable
            .Mode(GridSelectionMode.Multiple))
        .Filterable(filterable => filterable
            .Extra(false)
            .Operators(operators => operators.ForString(str => str.Clear()))
            )
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("FilterMenuCustomization_Read", "Inventory"))
            .PageSize(15)
        )
    )
</div>
 
 
 
<script type="text/javascript">
    $(function () {
        var grid = $("#grid").data("kendoGrid");
 
        $("#save").click(function (e) {
            e.preventDefault();
            var opt = grid.getOptions();
            var foo = kendo.stringify(grid.getOptions(), ['week', 'month']);
            var bar = JSON.parse(foo);
            localStorage["kendo-grid-options"] = kendo.stringify(grid.getOptions());
        });
 
        $("#load").click(function (e) {
            e.preventDefault();
            var options = localStorage["kendo-grid-options"];
            if (options) {
                var foo = JSON.parse(options);
                grid.setOptions(JSON.parse(options));
            }
        });
    });
 
    function shippingUnitFilter(element) {
        element.kendoAutoComplete({
            dataSource: {
                transport: {
                    read: "@Url.Action("FilterMenuCustomization_ShippingUnits")"
                }
            },
            optionLabel: "--Select Value--"
        });
    }
 
    function inventoryStatusFilter(element) {
        element.kendoDropDownList({
            dataSource: {
                transport: {
                    read: "@Url.Action("FilterMenuCustomization_InventoryStatus")"
                }
            }
        });
    }
 
 
 
</script>

Helen
Telerik team
 answered on 13 Apr 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
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?