Telerik Forums
UI for ASP.NET MVC Forum
9 answers
1.4K+ views
Hi,

Can anyone help me with this:

How to add a linear gauge/ progress bar in an kendo mvc grid column

I couldn't find any sample for it
Stefan
Telerik team
 answered on 06 Mar 2017
4 answers
284 views

Hi,

I have a grid has its edit mode set to GridEditMode.InlineCell, and when I click on a particular cell I show a ColorPicker.

My grid definition is as follows:

@(Html.Kendo().Grid<TelerikMvcApp1.Models.Item>()
.Name("Grid")
.DataSource(dataSource => dataSource
    .Ajax()
    .Model(model => model.Id(m => m.Id))
        .Read(read => read.Action("GetItems", "Home"))
        .Update(up => up.Action("UpdateItems", "Home")).Model(model =>
        {
            model.Id(p => p.Id);
            model.Field(p => p.Id).Editable(false);
            model.Field(p => p.Id).Editable(false);
            model.Field(p => p.Color).Editable(true);
        })
)
.Columns(columns =>
{
    columns.Bound(c => c.Id).Width(200);
    columns.Bound(c => c.Color).ClientTemplate("#= Color # <div style='background-color: #= Color #; padding:10px;'></div>"); ;
})
.Pageable()
.Sortable()
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Events(e => e.Edit("onEdit"))
)

 

The grid onEdit event is as follows:

function onEdit(e) {
    if (e.container.index() === 1) {
        var grid = e.sender;
        var colourPicker = $("#Color").data("kendoColorPicker");
        var originalColour = e.model.Color;
 
        colourPicker.bind({
            close: function () {
                var newColour = this.value();
 
                console.log("old colour = " + originalColour + ", new colour = " + newColour);
 
                if (newColour !== originalColour) {
                    console.log("colour has changed");
                    grid.saveChanges();
                }
                else {
                    console.log("colour has not changed");
                    grid.cancelChanges();
                }
            }
        });
 
        colourPicker.open();
    }
}

 

The model bound to the grid is as follows:

public class Item
{
    public int Id { get; set; }
 
    [UIHint("ColorEditor")]
    public string Color { get; set; }
}

 

The ColorEditor template is defined as follows:

@(Html.Kendo().ColorPicker()
      .Name("Color")
      .Value("#=Color#")
)

 

When the ColorPicker is displayed, I choose a colour, click Apply and then call saveChanges() on the grid so that I can update some data on the server. That all works fine.

The problem I have is that if I click Cancel (or click Apply without changing the color) I want to change the grid so that it is no longer in edit mode. I attempt to do that calling cancelChanges() on the grid. The call to cancelChanges() results in this error being thrown:

Uncaught TypeError: Cannot read property 'children' of null
    at init.close (kendo.all.min.js:24)
    at init.trigger (kendo.all.min.js:9)
    at init.window.kendo.window.kendo.devtools.kendo.ui.Widget.trigger (<anonymous>:587:33)
    at init._trigger (kendo.all.min.js:20)
    at init.close (kendo.all.min.js:20)
    at init.close (kendo.all.min.js:24)
    at init.cancel (kendo.all.min.js:24)
    at init.trigger (kendo.all.min.js:9)
    at init.window.kendo.window.kendo.devtools.kendo.ui.Widget.trigger (<anonymous>:587:33)
    at init._cancel (kendo.all.min.js:24)

 

Am I going about this the wrong way?

I have been able to reproduce this error with versions 2014.3.1411.545, 2015.3.1111.545 and 2017.1.223.545 of Kendo.Mvc.dll

Thanks,

David

David Larkin
Top achievements
Rank 1
 answered on 06 Mar 2017
1 answer
133 views

Hi,

Is there away when using an image to put the text below the image.

Regards

Dimiter Topalov
Telerik team
 answered on 06 Mar 2017
1 answer
245 views

Hello Sir,

 

I am try to fetch dynamic menu from sql server, i am using northwind database,i am using your mvc model binding code but i am getting below error

help me please

 

The model item passed into the dictionary is of type 'System.Data.Entity.DbSet`1[TelerikMvcApp3.EFwork.Category]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[TelerikMvcApp3.Models.Category]'.

thank you.
Nencho
Telerik team
 answered on 06 Mar 2017
1 answer
219 views
This examples http://demos.telerik.com/aspnet-mvc/grid/editing-custom mentions "Html.Kendo().DropDownListFor()" but the actual razor markup does not use this helper. Can someone show how to correctly use the drop down within the grid in MVC ?
Dimiter Topalov
Telerik team
 answered on 03 Mar 2017
4 answers
789 views
I'm sure there's some deep hidden nested style somewhere to define vertical column lines, but damned if I can find it.  How do I get vertical lines between my columns?
Dimitar
Telerik team
 answered on 03 Mar 2017
5 answers
2.4K+ views
Is there anyway to provide default grouping when the grid is rendered on the view? For example, in the grid below, I want to group by Type, by default. Thanks.

@(Html.Kendo().Grid<SomeModel>()
        .Name("Grid")
        .Columns(columns =>
        {  
            columns.Bound(p => p.TYPE).Title("Type");          
            columns.Bound(p => p.NAME).Title("Name");
            columns.Bound(p => p.CITY).Title("City");
        })        
        .Sortable()
        .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(100)
                .Read(read => read.Action("GetInfo", "Summary"))
        )
.Groupable (// group by first column)
Raj
Top achievements
Rank 1
 answered on 03 Mar 2017
2 answers
190 views

I have an Ajax.BeginForm that contains a button that allows you to open an existing Window (outside of the beginForm).

When I call the window and refresh with a new url, no matter what url is used or what is displayed in it, after the window is refreshed it makes a post back to the server for the BeginForm.

navbarWindowURL = "google.com";
navbarWindowData.refresh({
    url: navbarWindowURL
}).center();

 

Is theresomething about calling this code that would cause the BeginForm to PostBack?

I know you usually like example code to demonstrate the issue, but it would be really difficult to provide an example at this time.

 

Ivan Danchev
Telerik team
 answered on 03 Mar 2017
3 answers
1.4K+ views

Hello,

I have created a kendo grid using the asp.net mvc wrappers and I want to add a selection capability. I am interested in selecting all the rows when a filter is made or not, without going through each page. More or less, I want to know if it is possible to make the selection on the server-side not on the client. I have looked through this example:http://dojo.telerik.com/@Stephen/EMeZE and it is not applicable in my case because I need to open each page and select all the rows. Is an other alternative?

Thank you very much!

Tsvetina
Telerik team
 answered on 02 Mar 2017
1 answer
159 views

I have a splitter with two windows, left holds a treeview, the right a partial view that depends on the selected node in the treeview to select the content (via an onSelect event).

The problem is that this code sometimes works perfectly and sometimes does not - specifically it renders the "parent" page (including the splitter, treeview etc) inside the right hand pane.

I'm a newbie with MVC, javascript etc so have no idea where the problem is - nor can I reproduce it at will.

The javascript snippit is:

function onSelect(e) {
        try {
            var treeView = e.sender;
            var text = treeView.text(e.node);
            var data = treeView.dataItem(e.node);
            var id = data.id;
            console.log(id, text);
            var parent = null;
            try {
               parent = treeView.text(e.node.parentNode);
            } catch (e) {
                console.log(e.message);
            }
            
            $("#splitter").kendoSplitter();
            var splitter = $("#splitter").data("kendoSplitter");

            switch (text) {
                case "Case":
                    splitter.ajaxRequest("#right-pane", "PartialCase", { id: id });
                    break;

 

And using the F12 debug I can follow it to the "splitter.ajaxRequest" line at which point it populates the right window with the parent page.

 

I hope this is something stupid.

 

Thanks

Veselin Tsvetanov
Telerik team
 answered on 02 Mar 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?