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

I am trying to use a ListView control in an ASP.NET RC1 project. I have added all the required stuff from the documentation..

1. js and styles folders

2. script references in layout 

<script src="~/lib/kendo-ui/js/jquery.min.js"></script>
<script src="~/lib/kendo-ui/js/kendo.all.min.js"></script>
<script src="~/lib/kendo-ui/js/kendo.aspnetmvc.min.js"></script>

3. services.AddKendo(); in Startup.cs

However when I add this to my page I am getting a javascript error

jquery(...).kendoListView is not a function

 

@(Html.Kendo().ListView<Microsoft.Graph.Group>()
.Name("groupView")
.TagName("div")
.ClientTemplateId("grouplistTemplate")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Groups_Read", "Groups"))
)
)

 

What could the issue be?

 

Thanks
AJ

Marin
Telerik team
 answered on 03 Jun 2016
1 answer
263 views

I've overridden the treeview CSS using the following code and while everything looks fine in desktop Chrome/IE/Firefox I'm having trouble in Chrome on Android.  I'm seeing multiple icons to expand and contract the treeview nodes.  It appears to be displaying a 64px square of the sprite.

 

<style scoped>
    .k-icon, .k-tool-icon, .k-grouping-dropclue, .k-drop-hint, .k-column-menu .k-sprite {
        background-image: url('/content/kendo/2015.1.429/default/sprite_2x.png');
        border-color: transparent;
    }

    .k-icon {
        width: 32px;
        height: 32px;
    }

    .k-treeview .k-item {
        font-size: 28px;
    }

    .k-treeview .k-minus {
        background-position: 0 -256px;
    }

    .k-treeview .k-plus {
        background-position: 0 -286px;
    }

    .k-treeview .k-in {
        line-height: 32px;
    }

    .k-treeview .k-item, .k-drag-clue {
        font-size: 28px;
        padding: 0 0 0 32px;
    }

    .k-add {
        background-position: -96px -416px;
    }

    .k-insert-middle {
        background-position: -320px -96px;
    }

    .k-denied {
        background-position: -96px -96px;
    }

    .k-insert-bottom {
        background-position: -320px -128px;
    }

    .k-insert-top {
        background-position: -320px -64px;
    }
</style>

 

Thoughts

Peter Milchev
Telerik team
 answered on 03 Jun 2016
3 answers
163 views

I have a Kendo MVC Grid that has inline editing enabled.  The form has a master SAVE button on top of the form.  The intent is to let the user modify multiple rows and then do one master save.

 

So right now the EDIT button allows the user to edit the row values and presents an UPDATE button.  This works in that the update method specified in the grid's configuration fires the controller event.  In that event I just return the row that was sent in.  That is all working but we would like the red indicator to show in the row in the modified cells after the controller action and then be cleared when the master save button is clicked, and the JavaScript submits the form's modified rows to that controller action in an AJAX batch action on the form.

 

Can someone offer a possible solution?

 

Thanks

Reid
Top achievements
Rank 2
 answered on 03 Jun 2016
1 answer
205 views

I stuggle with this grid and editortemplate with a combobox. My model has a int? idAfdeling that is the foreign key.

With the valuePrimitive set to false, the idAfdeling remains null after a combobox item is selected, it will update once the initial idAfdeling is not null.

With the valuePrimitive set to true, the idAfdeling is updated after selecting an item, but the autobind option is not respected and an ajax call is made.

 

Now i wonder if there is any option to make the combination (combobox, nullable int, bind on demand) work..

@(Html.Kendo().ComboBoxFor(m => m)
    .DataTextField("Omschrijving")
    .DataValueField("idAfdeling")
    .DataSource(ds =>
    {
        ds.Read(read => read.Action("Afdelingen", "Afdeling", new { Area = "Tabellen" }).Data("passAfdeling"));
    })
    .HeaderTemplateId("AfdelingHeaderTemplate")
    .TemplateId("AfdelingTemplate")
    .Suggest(true)
    .ValuePrimitive(false)
    .AutoBind(false)
)

 

 

 

 

 

Bozhidar
Telerik team
 answered on 03 Jun 2016
7 answers
1.3K+ views
Hi

Is there a way to change the items in a dropdownlist (Category) based on a selection from another dropdownlist (Category Value)?

Thanks,
Konstantin Dikov
Telerik team
 answered on 03 Jun 2016
1 answer
96 views

How would one go about accomplishing the following in MVC: Import data from a database into the spreadsheet control and implement formula cells in certain columns.

I'm not sure the methodology to work in a sort of hybrid method using this control. Is there a way to feed formulas from the controller? Currently I am adding null values to properties of my viewmodel so the columns can show up in the spreadsheet, but these wipe out the formulae I am placing in the column. Here is the code I am using. Not the most elegant :)

 

@(Html.Kendo().Spreadsheet()
        .Name("spreadsheet")
        .HtmlAttributes(new { style = "width:100%" })
        .Excel(excel => excel
            .ProxyURL(Url.Action("Index_Save", "Spreadsheet"))
        )
        .Pdf(pdf => pdf
            .ProxyURL(Url.Action("Index_Save", "Spreadsheet"))
        )
        .Sheets(sheets =>
        {
            sheets.Add()
                .Name("Products")
                .DataSource<BBC.Bids.ViewModels.OrderViewModel>(ds => ds
                    .Ajax()
                    .Batch(true)
                    .Read(r => r.Action("Orders_Read", "Grid").Data("selectedOrder"))
                    .Update("Products_Update", "Spreadsheet")
                    .Create("Products_Create", "Spreadsheet")
                    .Destroy("Products_Destroy", "Spreadsheet")
                    .Events(e => e.Change("onChange"))
                    .Model(m =>
                    {
                        m.Id(p => p.LineNo);
                    })
                )
                .Columns(columns =>
                {
                    columns.Add().Width(25);
                    columns.Add().Width(200);
                    columns.Add().Width(100);
                    columns.Add().Width(25);
                    columns.Add().Width(50);
                    columns.Add().Width(50);
                    columns.Add().Width(50);
                    columns.Add().Width(50);
                    columns.Add().Width(50);
                    columns.Add().Width(50);
                    columns.Add().Width(50);
                    columns.Add().Width(50);
                })
                .Rows(rows =>
                {
                    rows.Add().Height(40).Cells(cells =>
                    {
                        for (var i = 1; i < 23; i++)
                        {
                            cells.Add()
                            .Bold(true)
                            .Background("#9c27b0")
                            .TextAlign(SpreadsheetTextAlign.Center)
                            .Color("white");
                        }
                    });

                    for (var i = 2; i < 500; i++)
                    {
                        rows.Add().Cells(cells =>
                        {
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add().Formula("J" + i + "*W" + i); // calculated freight cost
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                            cells.Add();
                        });
                    }

                });
        })
    )

Bozhidar
Telerik team
 answered on 02 Jun 2016
1 answer
180 views

Hi,

I have written a function that triggers when the Update event on the grid ends.  This is defined as :

.DataSource(dataSource => dataSource
               .Ajax()
               .Events(events =>
                   {
                       events.RequestEnd("onUpdateEnd");
                   })
               .Model(model =>
               {
                   model.Id(p => p.vessel_idx);                   
               })

My function is as follows:

function onUpdateEnd(e) {
 
       if (e.type == "update") {
           var grid = $("#Grid").data("kendoGrid"),
               dataItem = grid.dataItem($(this).closest("tr")),
               stop_date = document.getElementById("fixture_stop"),
               start_date = dataItem.fixture_start;
            
           if (end_date < start_date) {
               alert("Dates are wrong")
           } else {
               alert("Dates are correct")
           }
           $("#Grid").data("kendoGrid").dataSource.read();
       }      
   }

The problen that once the updateend function trigger, the console returns an error saying that dataItem is null (start_date) which crashes the application.  What am I doing wrong and why can't I grab that cell data for use in my function?

Many thanks

 

Konstantin Dikov
Telerik team
 answered on 02 Jun 2016
6 answers
4.2K+ views

Hi,

How can I change the default font of a MVC Project with all Kendo Controls / Widget i.e. to Segoe UI?

Peter

Peter
Top achievements
Rank 1
 answered on 01 Jun 2016
1 answer
219 views

Hi,

I don't find an example to plot a heatmap /  intensity chart.

Is a chart similar to the chart in the attached file possible with ASP.NET MVC?

Peter

Rumen
Telerik team
 answered on 01 Jun 2016
4 answers
1.0K+ views

Is there a way to have a Custom Command Button that is only visible when the user is editing a cell and becomes invisible when the editing is complete?  And if so, when clicked resets the row to it's original values.  Right now if the model annotations specifies [required] for a field, if the user starts to edit that column then changes there mind they still have to enter a valid value there. 

I ask this because using the default Edit Inline mode the Update button when clicked hits the controller and resets the dirty flag on the records so the red indicators go away.  We want to have a custom master "Save" button that does a master save of all rows at once.

So basically a way to use the default Edit, Update, Cancel mechanism built into Kendo that just leaves the red indicators and dirty flags when the user clicks the update button and also snaps the row out of edit mode.  In this respect we would not need a custom "cancel" button.

Any suggestions would be welcome.

 

Thanks

Venelin
Telerik team
 answered on 01 Jun 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?