Telerik Forums
Kendo UI for jQuery Forum
1 answer
801 views
I have a 3-level hierarchy grid and need to export all the data including collapsed rows to excel. I am following this demo http://dojo.telerik.com/ApaqOJuv. But it only export the expanded rows. How can I modify this solution so that it export all the data?
Alex Hajigeorgieva
Telerik team
 answered on 02 Apr 2020
1 answer
558 views

Hi All,



I work in one of the Big 4 firms and we have been using Kendo for a few years now but recently an issue has cropped up when virtual vertical scrolling does not work when the grid is sorted on a column. It does not matter what column. Scrolling works fine without the sorting when the grid loads. When sorted on any column the grid loads the first pagesize items but on going to the end of the page the new items does load. No call to the server also being made and no network or console activity

 

Here is the code

 

@(Html.Kendo().Grid<IGridItem>()<br>    .Name(gridName)<br>    .HtmlAttributes(new { @class = "table-response browse-table " + Model.GridType.ToString().ToLower() + "-grid-type" })<br>    .Columns(columns =><br>    {<br>        columns<br>            .Bound("Name")<br>            .Title(MarkupMessages.Grid_NameHeader)<br>            .Width(500)<br>            .HeaderTemplate("<span" + MarkupMessages.Grid_NameHeader + "</span>")<br>            .HtmlAttributes(new { @class = "name-column" })<br>            .ClientTemplate(nameColumnTemplate)<br>            .Locked(true)<br>            .Lockable(false)<br>            .Hidden(false)<br>            .Sortable(true)<br>            .Filterable(false)<br>            .Visible(Model.GridColumnConfiguration.HasFlag(GridColumnEnum.Name));<br>        columns<br>            .Bound("ID")<br>            .Title("")<br>            .Width(30)<br>            .HeaderTemplate("")<br>            .HtmlAttributes(new {@class = "context-menu-column"})<br>            .ClientTemplate(menuColumnTemplate)<br>            .Locked(true)<br>            .Lockable(false)<br>            .Hidden(false)<br>            .Sortable(false)<br>            .Visible(Model.GridColumnConfiguration.HasFlag(GridColumnEnum.ID))<br>            .Filterable(false);<br>        columns<br>            .Bound("Category")<br>            .Title(MarkupMessages.Grid_CategoryHeader)<br>            .Width(200)<br>            .ClientTemplate("<div>#: Category #</div> ")<br>            .Locked(false)<br>            .Lockable(false)<br>            .Hidden(false)<br>            .Sortable(true)<br>            .Visible(Model.GridColumnConfiguration.HasFlag(GridColumnEnum.Type))<br>            .Filterable(filter =><br>            {<br>                filter.Multi(true);<br>                filter.CheckAll(false);<br>                filter.ItemTemplate("itemTemplate");<br>                filter.DataSource(source =><br>                {<br>                    source.Read(r => r.Url(Model.Url));<br>                    source.Events(e => e.RequestStart("GridHelper.filterCancelRequest"));<br>                });<br>            });<br>        columns<br>            .Bound("LastModifiedDate")<br>            .Title(MarkupMessages.Grid_LastModifiedDateHeader)<br>            .Width(200)<br>            .ClientTemplate("<div>#: LastModifiedDate #<div>")<br>            .Locked(false)<br>            .Lockable(false)<br>            .Hidden(false)<br>            .Sortable(true)<br>            .Filterable(false)<br>            .Visible(Model.GridColumnConfiguration.HasFlag(GridColumnEnum.LastModifiedDate));<br>    .DataSource(ds => ds<br>        .Ajax()<br>        .ServerOperation(Model.ServerOperation)<br>        .Sort(sort =><br>        {<br>            if (Model.DefaultSortOrder == SortDirection.Descending)<br>            {<br>                sort.Add(Model.DefaultSort).Descending();<br>            }<br>            else<br>            {<br>                sort.Add(Model.DefaultSort).Ascending();<br>            }<br>        })<br>        .PageSize(200)<br>        .Read(read =><br>        {<br>            read.Url(Model.Url);<br>            read.Data(dataSourceGetAdditionalData);<br>        })<br>        .Events(events => events.Error(dataSource_Error)))<br>    .AutoBind(false)<br>    .Sortable(sortable => sortable.SortMode(GridSortMode.SingleColumn).AllowUnsort(false))<br>    .Scrollable(scrollable => scrollable.Virtual(true).Height(382))<br>    .Resizable(resizable => resizable.Columns(true))<br>    .Reorderable(reorder => reorder.Columns(true))<br>    .Filterable(filter =><br>    {<br>        filter.Enabled(true);<br>        filter.Extra(false);<br>    })<br>    .Events(events =><br>    {<br>        if (!String.IsNullOrEmpty(gridEvent_SelectionChanged))<br>        {<br>            events.Change(gridEvent_SelectionChanged);<br>        }<br><br>        if (!String.IsNullOrEmpty(gridEvent_DataBound))<br>        {<br>            events.DataBound(gridEvent_DataBound);<br>        }<br><br>        if (!String.IsNullOrEmpty(gridEvent_DataBinding))<br>        {<br>            events.DataBinding(gridEvent_DataBinding);<br>        }<br><br>        if (!String.IsNullOrEmpty(gridEvent_FilterInitialize))<br>        {<br>            events.FilterMenuInit(gridEvent_FilterInitialize);<br>        }<br><br>        if (!String.IsNullOrEmpty(gridEvent_ColumnReorder))<br>        {<br>            events.ColumnReorder(gridEvent_ColumnReorder);<br>        }<br>    }))
Preslav
Telerik team
 answered on 02 Apr 2020
3 answers
338 views
Hi,

I am trying to enable inline editing for the KendoUI grid with an autocomplete control. I want to be able to post the edited model data into a controller action, however my parametermap code never gets executed. Can someone please explain what causes the parametermap code to get executed?

Here is my dataSource declaration:
var battingDataSource = new kendo.data.DataSource({
    schema: {
        model: {
            id: "PlayerId",
            fields: {
                PlayerId: { editable: false, nullable: true },
                PlayerFullName: { validation: { required: true } },
                BattingOrder: { type: "number", validation: { required: true, min: 1, max: 11 } },
                RunsScored: { type: "number", validation: { required: true, min: 0 } },
                BallsFaced: { type: "number", validation: { required: true, min: 0 } },
                Fours: { type: "number", validation: { required: true, min: 0 } },
                Sixes: { type: "number", validation: { required: true, min: 0 } },
            }
        }
    },
    batch: true,
    transport: {
        create: {
            url: "/MatchPlayer/Create",
            type: "POST"
        },
        update: {
            url: "/MatchPlayer/Update",
            type: "POST"
        },
        read: {
            url: "/MatchPlayer/Read",
            type: "POST"
        },
    },
    parameterMap: function (data, operation) {
        alert("hit");
        if (operation != "read") {
            // post the players so the ASP.NET DefaultModelBinder will understand them:
 
            var result = {};
 
            for (var i = 0; i < data.models.length; i++) {
                var player = data.models[i];
 
                for (var member in player) {
                    result["players[" + i + "]." + member] = player[member];
                }
            }
 
            return result;
        }
    }
});
Yaroslav
Top achievements
Rank 1
 answered on 02 Apr 2020
5 answers
6.4K+ views
Hello,

I have a basic web application that I would like to use Kendo UI on. This application has a basic banner whose content is dynamically sized. Below this banner, I would like to use a Kendo UI Grid control. This Grid needs to fill the remaining available space. My question is, how you make a Grid dynamically grow to fill the available height? All of the demos I see use absolute heights.

Thank you!
Aleksandar
Telerik team
 answered on 01 Apr 2020
1 answer
345 views

     I have a form with a few fields. I want to take the form data and pass it to a Kendo Datasource so when I hit "Save" it will call my existing back-end JSDO class and save the data to the database. Are there examples of this anywhere?

 

I have found an example of a remote bound form to save to the back-end with an already existing DB record (ID). But my request is for new records with no ID.

https://demos.telerik.com/kendo-ui/mvvm/remote-binding

Aleksandar
Telerik team
 answered on 01 Apr 2020
11 answers
1.1K+ views

I am evaluating Kendo UI Grid trial version to replace a third party grid control being used in one existing web forms application.
Environment : ASP.NET Web Forms Application (NOT MVC) (.NET Framework 4.5, upgraded from .NET Framework 2.0), Oracle 11g.
Browser : IE 11.
I am trying to implement Virtual scrolling with Remote data.
But it is not working. Data is only visible up to the height of the grid. Scroll bar is not appearing.
Setting
serverPaging: true,
serverSorting: true
does not show any data.

Could anyone tell me where I am going wrong ?
The server side function GetData() invokes database stored procedure which returns all data. It will not be possible to implement paging in the store procedures as there are a very large number of different grids aka stored procedures. If this is the cause of Virtual Scrolling not working, please suggest me the work around.

Sample code is as follows:

 

ManageUsers.aspx
 
<asp:Content ContentPlaceHolderID="mainContent" ID="conPort" runat="server">
     
    <link href="styles/kendo.common.min.css" rel="stylesheet" />
    <link href="styles/kendo.metro.min.css" rel="stylesheet" />
    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.all.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function ()
        {
            $('#dvGrid').kendoGrid({
                scrollable: { virtual: true },
                sortable: true,
                selectable: "row",
                filterable: true,
                dataSource:
                    {
                        transport:
                            {
                                read:
                                    {
                                        url: "ManageUsers.aspx/GetData",
                                        type: "POST",
                                        contentType: "application/json; charset=utf-8",
                                        dataType: "json"
                                    }
                            },
                        schema:
                            {
                                data:
                                  function (response)
                                  {
                                      return $.parseJSON(response.d);
                                  }
                            },
                        type:"json",
                        pageSize: 10//,
                        //serverPaging: true,
                        //serverSorting: true,
                        //batch: true
                    },
                columns: [
                {field: "ID", title: "USER ID"},
                {field: "USER_NAME", title: "USER NAME"}
                ]
            });
        });
    </script>
 
    <div>
        <div id="dvGrid" class="k-widget k-grid" style="width:450px;height:350px"></div>
    </div>
 
</asp:Content>
 
////////////////////////////////////////
 
ManageUsers.aspx.cs
 
using Newtonsoft.Json;
 
[System.Web.Services.WebMethod]
        public static string GetData()
        {
            TblUser objTblUser = new TblUser();
            DataSet objDataSet = new DataSet();
            objDataSet = objTblUser.DataSetLoad("A", 0);
             
            DataView dvw = objDataSet.Tables[0].DefaultView;
            dvw.RowFilter = " USER_NAME LIKE 'E%' ";
             
            return JsonConvert.SerializeObject(dvw.ToTable());
        }
 
 
////////////////////////////
 
The converted JSon data is as follows:
 
[{"ID":2.0,"USER_NAME":"DANIEL S"},{"ID":3.0," USER _NAME":"DANIEL Z"},{"ID":6.0," USER _NAME":"DANIELS"},{"ID":19.0," USER _NAME":"DAVID"},{"ID":42.0," USER _NAME":"DEEPAK"},{"ID":48.0," USER _NAME":"DELIA"},{"ID":56.0," USER _NAME":"DEYAN"},{"ID":57.0," USER _NAME":"DHEERAJ"},{"ID":67.0," USER _NAME":"DURIAN"},{"ID":71.0," USER _NAME":"DIMITAR"},{"ID":89.0," USER _NAME":"DIMITAR Z"},{"ID":90.0," USER _NAME":"DOBROMIR"},{"ID":96.0," USER _NAME":"DUNCAN"}]

Tsvetomir
Telerik team
 answered on 01 Apr 2020
5 answers
306 views

Hello,

We have a donu chart we draw with the kendo ui vue chart and it looks good. We place it in a small html iframe as you can see in the attached screen shot.
The chart is using 100% of the (small) frame size. As you can see in the attached screen shot, it is not vertically aligned. Since the generated svg occupies 100% of the area I assume it is something in the seriesDefaults to tweak for it to be vertically centered. But I could not find how to do it. Please advise.


Thanks,

Ron.

Alex Hajigeorgieva
Telerik team
 answered on 01 Apr 2020
1 answer
165 views

Hi there,

On tab drag i want to update a field in the datasource.  But as soon as datasource sync is called an "Index of undefined" error is received.  This is the sortable section of the tabstrip:

var configureSortable = function () {
            $("#tabstrip ul.k-tabstrip-items").kendoSortable({
                filter: "li.k-item",
                axis: "x",
                container: "ul.k-tabstrip-items",
                hint: function (element) {
                    return $("<div id='hint' class='k-widget k-header k-tabstrip'><ul class='k-tabstrip-items k-reset'><li class='k-item k-state-active k-tab-on-top'>" + element.html() + "</li></ul></div>");
                },
                start: function (e) {
                    tabstrip.activateTab(e.item);
                },
                change: function (e) {
                    var tabstrip = $("#tabstrip").data("kendoTabStrip"),
                        reference = tabstrip.tabGroup.children().eq(e.newIndex);

                    if (e.oldIndex < e.newIndex) {
                        tabstrip.insertAfter(e.item, reference);
                    } else {
                        tabstrip.insertBefore(e.item, reference);
                    }
                },
                move: function(e) {
                    //NOTE: the heading element will be excluded from the
                    //collection as it does not match the filter
                    //e.preventDefault();
                    //shows the original position of the item
                    var originalPos = this.indexOf(e.item);
                    console.log("index of item", originalPos);
                    //shows the position where item will be moved to
                    var newPos = this.indexOf(this.placeholder);
                    console.log("index of placeholder", newPos);
                    //var item = tabStrip.dataSource.at(originalPos);
                    //console.log(item.id + item.pos + item.name + item.status + newPos);
                    //item.set("pos", newPos);
                    //tabStrip.dataSource.sync();
                    var tabstrip = $("#tabstrip").data("kendoTabStrip");
//this gives me a null
                    //var dataItem = tabstrip.dataSource.get(e.item.data("id"));
                    var dataItem = tabstrip.dataSource.at(originalPos);
     //i tried this as well
                    //tabstrip.dataSource.remove(dataItem);
                    //tabstrip.dataSource.insert(newPos, dataItem);
                    dataItem.set("pos", newPos);
                    tabstrip.dataSource.sync();
                }
            });
        };

Plamen
Telerik team
 answered on 01 Apr 2020
5 answers
1.8K+ views
I was wondering if there was a way to get the refresh button to show up without having paging turned on.  I have a grid with virtual scrolling, so I want paging turned off.  But I also want to have the refresh button available on the bottom-right of the grid.  It looks like the only way to allow this is to turn paging on.  Is this correct or is there another way to get the refresh button to show up?  Thanks!

Regards,
Brian
Joon-Sae
Top achievements
Rank 1
 answered on 31 Mar 2020
1 answer
146 views

I am seeing VERY strange behavior using a kendoValidtor with a listView. The listview is a table and each line looks like this:

 

<script type="text/x-kendo-tmpl" id="tmplMenuOptionsGroupRow">
  <tr>
      <td class="w-25">
          <i class="fal fa-arrows fa-2x dragHandler"></i>
      </td>
      <td class="w-50">
          <input name="optionDesc" class="form-control k-textbox k-input-lg" required validationMessage="Enter Description"
              data-bind="value: description, disabled:legacy, events:{change: editorModel.menuOptionGroup.onMenuItemOptionsGroupChange}" />
              
      </td>
      <td class="w-25 dragHide text-left">
          <input class="w-100 k-input-lg" data-role="numerictextbox"
              data-format="c"
              data-min="0"
              data-format="c2" name="optionPrice"
              data-spinners=false required validationMessage="Enter Price"
              data-bind="value:price, disabled:legacy, events:{change: editorModel.menuOptionGroup.onMenuItemOptionsGroupChange}" />
              <span class="k-invalid-msg" data-for="optionPrice"></span>
               
      </td>
       
      <td class="dragHide" >
          <button type="button" class="btn btn-danger btn-sm" data-bind="click:editorModel.menuOptionGroup.deleteOption, disabled:legacy"><i class="fal fal fa-trash-alt"></i>
          </button>
      </td>
  </tr>
</script>

 

 

As you can see the optionDesc field is a mandatory field and I have defined a validationMessage when it is empty.

However when I test it I see the following results (see 2020-03-29_1045.png)

As you can see the error message appears nexts ALL the optionDesc fields and not just the one that is missing.

So I thought I would try a different approach with the optionPrice field (also required). so I added a k-invalid-msg right next to the field in the same <tr> and <td >as the input. 

However it also behaves incorrectly and even MORE strangely. Basically the error message is displayed in the correct spot the first time. After that if any other field in another row is blank the error message is displayed in the original place and NOT next to the empty field. See image 2020-03-29_1049.png as an example. The field in row 3 is missing but the error message is showing in row 1 where it was previously missing.

Anyone have ideas/suggestions?

Alon

 

 

 

 

Ivan Danchev
Telerik team
 answered on 31 Mar 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
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?