Telerik Forums
UI for ASP.NET MVC Forum
2 answers
596 views
Hello Telerik support team,

I have the latest Kendo UI MVC installed on my computer. I am using Visual Studio 2013 to develop ASP.NET MVC applications. 

I am currently looking for a way to make a menu on my application. I came across an article where I am able to bind the Menu control with a site map. I have that done in my application. Want I want to do now is make it work similar to how Bootstrap already does things. I know there is a post here on the forums where it says that you guys didn't have close integration with Bootstrap for the controls. That post was from last year and might or might not be relevant. 

I'm not sure if you guys are using the Kendo UI Menu in your website here: http://www.telerik.com/kendo-ui
But if you are I would like to know how you guys are making that 3 bar icon to show up when you resize the window. That is something that I am looking for.

Thank you,
David
Carlos
Top achievements
Rank 1
 answered on 01 Mar 2017
1 answer
132 views

Kendo version: 2015.1.429

We got an IndexOutOfRangeException error as attached.  Please advise.

Thanks

 

 

Ivan Danchev
Telerik team
 answered on 01 Mar 2017
1 answer
374 views

I'm quite confused as to when I need to prefix my row data with "data." versus when I don't.

For instance, the example on the FAQ never mentions that you need to prefix "Enable with "data." (i.e. "data.Enabled") to access the Enabled field. But in my code if I don't do "data.Enabled" I get an undefined error.

But, if I do something like

#= fieldName != null  ?  kendo.toString(fieldName)  :  '' #

I don't have to do data.fieldName. Also, many example I find in the forums sometimes include data. and other times they dont. Is there some place I can look at that tells me when I need to use "data." and when I don't?

 

 

 

Boyan Dimitrov
Telerik team
 answered on 28 Feb 2017
1 answer
592 views

I have a hierarchical grid, using MVC, and in the detail (child) table, I want the user to be able to create a new row and the row will contain an Autocomplete field. I have everything wired up, the grid displays correctly, with data. When the user clicks Add New Record, a new row is displayed with the Autocomplete field. However, for some reason, no data is being retrieved from the server (the controller method isn't getting called at all) when the user starts typing. Here is the code for the autocomplete editor and the detail table:

@(Html.Kendo().AutoComplete()

          .Name("Combined")
          .ValuePrimitive(true)
          .DataTextField("Combined")
          .Filter("contains")
          .MinLength(3)
          .HtmlAttributes(new { style = "width:200px" })
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetAntiqueCategories", "Customer");
              })
              .ServerFiltering(false);
          })
)

<script id="template" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<Entities.AntiqueCategory>()
            .Name("grid_#=RowId#")
            .Columns(columns =>
            {
                columns.Bound(o => o.Combined).EditorTemplateName("Combined");
                columns.Command(command => { command.Destroy(); }).Width(200);
            })
            .ToolBar(toolbar =>
            {
                toolbar.Create();
                toolbar.Save();
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(10)
                .Model(model => model.Id(p => p.RowId))
                .Read(read => read.Action("ReadCustomerWantDetail", "Customer", new { customerId = "#=RowId#" }))
                .Create(update => update.Action("CreateCustomerWantDetail", "Customer", new { customerId = "#=RowId#" }))
                .Update(update => update.Action("CreateCustomerWantDetail", "Customer", new { customerId = "#=RowId#" }))
                .Destroy(update => update.Action("DeleteCustomerWantDetail", "Customer"))
            )
            .Editable(editable => editable.Mode(GridEditMode.InCell))
            .Pageable()
            .Sortable()
            .ToClientTemplate()
    )
</script>

Tsvetina
Telerik team
 answered on 28 Feb 2017
1 answer
658 views

Hello,

I need to validate user input for ipv4 adress. I am using maskedtextbox. How can i set mask property of maskedtextbox?

I write this code but it doesn't work. ?

<body>
 
<input id="maskedtextbox" />
<script>
$("#maskedtextbox").kendoMaskedTextBox({
    mask: "~",
    rules: {
        "~":((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
    }
});
</script>
</body>

Viktor Tachev
Telerik team
 answered on 28 Feb 2017
9 answers
425 views
Hello,

we have Hierarchical DataSource with multilevel and with dynamic images. So ned to load only the parent nodes first and clicking on each node should call back controller method and load children on Onselect event. I am facing the following problem.
1-First i tried to implement a read method like remote datasource binding and loaded the parents nodes , but then it will not display anything.
@(Html.Kendo().TreeView()
    .Name("treeview")
    .HtmlAttributes(new {@class="demo-section" })
    .DataTextField("Text")
    .DataSource(dataSource => dataSource
        .Read(read => read
            .Action("ReadObjects", "TreeView")
        )
    )
 public JsonResult ReadObjects()
        {

            List<TreeViewItemViewModel> result = new List<TreeViewItemViewModel>();
           

           
            return Json(result, JsonRequestBehavior.AllowGet);
        }

2. So i tried the other option to bind and it displays the root level. But how do i load children on select event?
@(
        Html.Kendo().TreeView()
            .Name("treeview")
            //.DataSpriteCssClassField("spriteCssClass")
             .HtmlAttributes(new {@class="demo-section" })
             .Events(events => events
        .Select("onSelect")    
    )
            .BindTo((IEnumerable<TreeViewItemModel>)ViewBag.inlineDefault)
    )

Is there a sample in mvc to refer. Also when i set imageURL it is not showing images.

Thanks

Anamika
Mark
Top achievements
Rank 1
 answered on 27 Feb 2017
2 answers
118 views

I have a grid that I am editing InCell.  When I use the tab to navigate to the next cell it retains entered data and refocuses on the next cell as expected.   But, If I enter data in a cell and then click into another cell the data I entered is not retained and I don't get the warning message that the data was required.  I also have an issue where if I click off the cell with an active required warning it hangs up sometimes and won't refocus on the cell if I click on it.  I can get around this sometimes by tabbing twice which refocus on the cell with the warning.  Also, if I return to a cell to edit the contents the curser is positioned before the first character and I have to use the arrow keys to reposition within the text to make corrections.  I can't just click into the text to the position where I want to edit. Is this how it is supposed to work?  I have used IE, Firefox, and Chrome and it works the same way regardless of the browser. Any help would be greatly appreciated. 

Operating System - Windows 7 64bit 
.Net framework - Version 4.5.1
Visual Studio version - Visual Studio 2015
Preferred Language - C Sharp
MVC Version - MVC 5
View Engine - Razor
Version - 2016.3.1118
Product - Kendo UI Grid for ASP.NET MVC

JQuery - 2.2.0 as advised under ticket ID 1069790

Katharine
Top achievements
Rank 1
 answered on 27 Feb 2017
1 answer
200 views

I'm trying to use a grid with an existing db table that can't be altered.

There's no key, just a CAR_CD and CAR_DESC, both defined as strings.

In my datasource, when I don't specify a model.Id (like below), I get an error "There is no DataSource Model Id property specified."  in the Visual Studio debugger.  It's looking for an Id.

.DataSource(dataSource =>
        dataSource.Ajax()
        .PageSize(50)
        .Batch(true) // Enable batch updates
        .Model(model =>
        {
            model.Field(car => car.CAR_CD).Editable(true);
            model.Field(car => lob.CAR_DESC).Editable(true);
        })

 

SO... I change the CAR_CD to an Id (see below) and then get "CS1660: Cannot convert lambda expression to type 'string' because it is not a delegate type".

{
            model.Id(car => car.CAR_CD).Editable(true);
            model.Field(car => lob.CAR_DESC).Editable(true);
        })

 

Is there an easy way to use a natural key (CAR_CD + CAR_DESC)?  I can test them for uniqueness in the .net code, but I need to get the grid to function.

 

Thanks.

Duke
Top achievements
Rank 1
 answered on 27 Feb 2017
1 answer
4.2K+ views

I am trying to create a line chart binding to grouped data, but when I use the code below I get a "CS0411: The type arguments for method 'Kendo.Mvc.UI.Fluent.DataSourceGroupDescriptorFactory<object>.Add<TValue>(System.Linq.Expressions.Expression<System.Func<object,TValue>>)' cannot be inferred from the usage. Try specifying the type arguments explicitly." error when I run it and in Visual Studio it underlines the ".Add" for group.Add and all the property names of the model (see attached screenshot).

Any ideas why?

View:

@model IEnumerable<IntegrationLoader.Models.Application>
 
@(Html.Kendo().Chart()
        .Name("chart")
        .Title("Fatal Exceptions In Last 10 Days")
        .Legend(legend => legend
            .Position(ChartLegendPosition.Bottom)
        )
        .ChartArea(chartArea => chartArea
            .Background("transparent")
        )
        .SeriesDefaults(seriesDefaults =>
            seriesDefaults.Line().Style(ChartLineStyle.Smooth)
        )
        .DataSource(dataSource => dataSource
            .Read(read => read.Action("AppCounts_Read", "LogEntries"))
            .Group(group => group.Add(model => model.Name))
            .Sort(sort => sort.Add(model => model.Day).Ascending())
        )
        .Series(series =>
        {
            series.Line(model => model.FatalCount)
                .Name("#= group.value # (Count)");
        })
        .CategoryAxis(axis => axis
            .Categories(model => model.Day)
            .Labels(labels => labels.Format("yyyyMMdd"))
        )
        .ValueAxis(axis => axis
            .Numeric().Labels(labels => labels.Format("{0}"))
            .Line(line => line.Visible(false))
            .AxisCrossingValue(-10)
            .Title("Errors")
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Format("{0}")
        )
)

 

Thanks,
Bill

Alex Hajigeorgieva
Telerik team
 answered on 27 Feb 2017
4 answers
232 views
Could someone provide or point me to a working example of how to popup add and edit a grid item that also contains a foreign key.
e.g.

ProductType:
ID
Name

Product:
ProductID
ProductName
ProductType

Product            Product Type
Peas                Vegetable
Melon               Fruit

Konstantin Dikov
Telerik team
 answered on 27 Feb 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
DropDownButton
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
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?