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

Hi,

 I have probably missed something really obvious, but I just can't seem to find the right property.

 I have a Grid bound to an OData source from which I am auto generating the columns. When this happens the column titles are not split around capital letters so they are readable unlike when they are bound individually. I tried using a column build action to set the titles of the columns, but it doesn't seem to work... unless I am doing something not quite right.

 A bit of example code here (I have just tried to change the column name to a set value, but it doesnt work when I try to split the column member name either)

@(Html.Kendo().Grid<dynamic>()
      .Name(Model.Name)
      .Columns(columns =>
      {
          //columns.AutoGenerate(true);
          //columns.AutoGenerate(col => col.Title = col.Member.SplitPascalCase());
          columns.AutoGenerate(col => col.Title = "COLUMN NAME");
      })
      .DataSource(dataSource => dataSource
          .Custom()
          .Type("odata")
          .Schema(schema =>
          {
          schema.Data("value")
              .Total
              (
                    @<text>
                        function total(data)
                        {
                        return data["odata.count"];
                        }
                    </text>
                );
          })
          .Transport(transport =>
          {
              transport.Read(read => read.Url(Model.ODataPath).DataType("json"));
          }
          )
          .PageSize(Model.PageSize)
          .ServerPaging(true)
          .ServerSorting(true)
          .ServerFiltering(true)
      )

thanks,

 Rob

Nikolay Rusev
Telerik team
 answered on 15 Oct 2015
4 answers
383 views

Hello,

 

We are updating a project to the most recent release (2015.3.930), pretty much specifically to fix the whole "No records found" scenario.  Currently we use the javascript method people have come up with, putting a setTimeout on the DataBound event of the grid, but this is pretty unreliable and as such, when the official No Records Found came out, we would prefer to use that.

 

It seems however that in our most unreliable case (a nested grid, 5 levels down, business requirement), the now-built-in NoRecords is not working at all.  It works fine on single level grids, but in this instance, when the grid is a Client Template (using .ToClientTemplate() - we use the fluent API for MVC), it doesn't do anything.

 

I thought maybe it was because we had Pageable disabled (.Pageable(paging => paging.Enabled(false))) and so there was no footer, but even enabling this didn't make it work.  The footer correctly detects that there are no items found (as it displays that default message in the bottom right corner), but the .NoRecords("No Records Found!") does not render in the grid, or in the DOM at all.

 

The below is what gets rendered, which has no message for the no records found.

 

<table role="grid">
<colgroup>
<col style="width: 22%;">
<col style="width: 21%;">
<col style="width: 40%;">
<col style="width: 10%;">
</colgroup>
<thead class="k-grid-header" role="rowgroup">
<tr role="row">
...
</tr>
</thead>
<tbody role="rowgroup">
<tr class="k-no-data">
<td colspan="4">
</td>
</tr>
</tbody>
</table>

 

 The definition of the subgrid is as follows

 

<script id="SuperSubGridTemplate" type="text/kendo-tmpl">    
        @(Html.Kendo().Grid<ReportSuperSubGridVM>()
              .Name("SuperSubGrid")
              .Columns(column =>
              {
                  column.Bound(x => x.Column1).Width("22%").Title(@Resources.Global.Column1);
                  column.Bound(x => x.Column2).Width("21%").Title(@Resources.Global.Column2);
                  column.Bound(x => x.Column3).Width("40%").Title(@Resources.Global.Column3);
                  column.Bound(x => x.Column4)
                      .ClientTemplate("\\#if(Column4){\\# " + @Resources.Global.Yes + "\\#}else{\\#" + @Resources.Global.No + "\\#}\\#")
                      .Width("10%")
                      .Title(@Resources.Global.Column4);
              })

              .DataSource(dataBinding => dataBinding
                  .Ajax()
                  .PageSize(500)
                  .Read(read => read.Action("GetSuperSubGridData", Constants.Controller_Report, new
                  {
                      Parameter1 = "#=ParentColumn1#"
                      ,Parameter2 = "#=ParentColumn2#"
                      ,Parameter3 = "#=ParentColumn3#"
                      ,Parameter4 = "#=ParentColumn4#"
                      ,Parameter5 = "#=ParentColumn5#"
                      ,Parameter6 = "#=ParentColumn6#"
                      ,Parameter7 = "#=ParentColumn7#"
                      ,Parameter8 = "#=ParentColumn8#"
                      ,Parameter9 = "#=ParentColumn9#"
                      ,Parameter10 = "#=ParentColumn10#"
                  }))
                   .Sort(c => c.Add(x => x.Column1))
              )              
              .Scrollable(scrolling => scrolling.Enabled(false))
              .Sortable()
              .Filterable(filtering => filtering.Enabled(true))
              .Pageable(paging => paging.Enabled(false))
              .NoRecords(@Resources.Global.NoResultsFound)
              .ToClientTemplate()
 )
</script>

  

Again, this works on non-nested grids, but for some reason I can't seem to get it to work on this one.

 

Thank you for any help!

CHRISTOPHER
Top achievements
Rank 1
 answered on 14 Oct 2015
1 answer
154 views

Hello,
I have a problem with a client detail template with a grid. If Kendo is localized into Czech can not open the detail view. Commented <globalization culture = "cs-Cz" uiCulture = "cs-CZ" /> in the web.config file to fix the problem.
I attach a simple project on which it is seen.

I delete kendo scripts and css from project.

Rosen
Telerik team
 answered on 14 Oct 2015
4 answers
350 views

We have a DropDownList that has several thousand records, so we set it up using Virtual following the example of the Virtualization demo.  We have a new requirement that those records need to be filtered by the selection of a different DropDownList, so this virtual DropDownList will need to cascade from the other DropDownList.  Even filtered, there will still be a thousand records in the DropDownList, so it still needs to be virtual.

Is it possible to use virtualization with a DropDownList that cascades?

Kevin
Top achievements
Rank 1
 answered on 13 Oct 2015
2 answers
177 views

Hi,

We are designing an application using ASP MVC , Fluent NHibernate and Kendo UI.
The client now has a requirement to abstract the datalayer(Entity Framework) using plane WCF service(notWCF 

 

 

 

Boyan Dimitrov
Telerik team
 answered on 13 Oct 2015
1 answer
237 views

Hello, I have recently downloaded the Kendo MVC toolkit planning to get it implemented for web app. I am confused not good with Jquery. In have used HTML decode function to pass a string data to the view. Where I decode it like @Html.Raw(WebUtility.HtmlDecode(Model.GetTreeLists())) inside a div and simple pass the id to Kendotreeview like

$("#treeData").kendoTreeView({
});

Now I have also a Kendo grid on a same view and I would like to populate the grid by selecting a record inside my treeview any suggestions would be appreciated..

Boyan Dimitrov
Telerik team
 answered on 13 Oct 2015
6 answers
2.0K+ views
I have kendo mvc wrappers in several projects, but in one project I keep getting this error, no matter what control I am using

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'kendoButton'

I have checked my project again others that are working and I cant see any difference so I am concussed as to why it is not working.

Can you tell me what would cause this error  to helpme narrow it down.

I have the right scripts I believe and all scripts and css return a status 200

<script src="/Scripts/jquery-2.1.0.js"></script>
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="/scripts/jscript/thatsfunctions.js"></script>
<script src="/scripts/jscript/site.js"></script>
<script src="/scripts/kendo/kendo.all.min.js"></script>
<script src="/scripts/kendo/kendo.aspnetmvc.min.js"></script>

I have the ref to the dll, I have the namespace in webconfig

<add namespace="Kendo.Mvc.UI" />

Any ideas would be appreciated, as I have spent hours trying to get this to work, thanks
Dimiter Madjarov
Telerik team
 answered on 13 Oct 2015
1 answer
145 views

The filter not work can you help me ? error serialization on call wcf.

DataSourceRequest 

 

http://www.telerik.com/forums/kendo-mvc-and-wcf

Kiril Nikolov
Telerik team
 answered on 13 Oct 2015
1 answer
136 views

I have the following model that I populate in the backend (controller):

public sealed class ItemGroupFlatModel
{
    public ItemGroupFlatModel()
    {
    }
 
    public int Id { get; set; }
 
    public string Name { get; set; }
 
    public string Description { get; set; }
 
    public int? ParentId { get; set; }
 
    public bool CanDelete { get; set; }
 
    public bool CanMove { get; set; }
 
    public bool AllowAdd { get; set; }
 
    public bool AllowEdit { get; set; }
}
 

and then pass to the front end using:

 

public JsonResult All([DataSourceRequest] DataSourceRequest request, int parentId)
{
    ItemGroupFlatViewModel model = _finderService.LoadFlatTreeModel(parentId);
 
    // null all parents that do not exist in tree
    List<int> ids = model.Children.Select(c => c.Id).ToList();
    model.Children.Where(c => c.ParentId.HasValue && !ids.Contains(c.ParentId.Value))
        .ToList().ForEach(c => c.ParentId = null);
 
    TreeDataSourceResult result = model.Children.ToTreeDataSourceResult(request,
        e => e.Id,
        e => e.ParentId,
        e => e
    );
 
    return Json(result, JsonRequestBehavior.AllowGet);
}

My Razor View is defined as:

<div class="demo-section k-header">
    @(Html.Kendo().TreeList<ItemGroupFlatModel>()
        .Name("itemgroup-treelist")
        .Columns(columns =>
        {
            columns.Add().Field(e => e.Name).Width(200); //.TemplateId("photo-template");
            columns.Add().Field(e => e.Description).Width(300);
            columns.Add().Width(200).Command(c =>
            {
                c.Edit();
                c.Destroy();
            });
        })
        .Editable(editable =>
        {
            editable.Move(true);
            editable.Mode("inline");
        })
        .Scrollable(true)
        .Selectable(true)
        .DataSource(dataSource => dataSource
            .Read(read => read.Action("All", "ItemGroup", new { parentId = Model.ParentId }))
            .ServerOperation(false)
            .Model(m =>
            {
                m.Id(f => f.Id);
                m.ParentId(f => f.ParentId);
                m.Expanded(true);
                m.Field(f => f.Name);
                m.Field(f => f.ParentId);
                m.Field(f => f.Id);
            })
        )
        .Height(540)
    )
</div>

I want to be able to control what can get dragged if  CanMove = true and prevent it if CanMove = false.  I want to prevent moving to a specific node if CanAdd = false and allow if CanMove = true.

Additionally, I want to prevent Delete if CanDelete = false.

Can this be done?

Cheers,

Andez

Alex Gyoshev
Telerik team
 answered on 13 Oct 2015
1 answer
141 views

We are working on an application in which the Grid control is being used to enter a number of line items which do not need to be stored in the database until the whole order is completed. We are using the batch editing mode and heavy client template use in order to get row data to fit the model of the page.

As part of the application, we want to automatically, via Ajax, populate item data when a user selects the item from a dropdown. Prior to moving to the batch edit mode, we were attempting to use the inline edit mode, and were able to attach our event handlers properly by calling a function off of the Grid's Edit() event handler, as it was called after the row was added to the DOM. We can bind the same function to the DataSource's Change() event, but this event fires before the new row is added to the DOM, so our event bindings fail.

What we would like is to be able to bind our events on row creation through the Grid or DataSource's initialization. If there is an alternate method to handle the controls in the row's event bindings, that is acceptable as well.

Kendo UI Version: 2015.2.902.545

OS: Windows 8 for development, Server 2008 R2 and up compatibility required

Browser: IE10+, Chrome (latest three)

jQuery: 2.1.4

 

Nathaniel
Top achievements
Rank 1
 answered on 12 Oct 2015
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?