Telerik Forums
UI for ASP.NET MVC Forum
1 answer
1.3K+ views

Hi team,

 How to change kendo grid property  using jquery. i want change property of kendo Grid. 

if (Some condition)

{

        var grid = $("#GridGlobalNewRequest").data("kendoGrid");
        grid.dataSource.options.schema.model.fields.StartCompany.editable = true;
        grid.dataSource.options.schema.model.fields.IsRead.editable = true;

}

else

{

         var grid = $("#GridGlobalNewRequest").data("kendoGrid");

        grid.dataSource.options.schema.model.fields.StartCompany.editable = false;

        grid.dataSource.options.schema.model.fields.StartCompany.defaultValue = "9990"; // Default Value

}

 

Thanks

Senthilkumar N

Boyan Dimitrov
Telerik team
 answered on 01 Jul 2015
3 answers
564 views

Hi

How do insert a control within a Panel.

As an example below with the Panel Getting Started I would have the text "Testing" and then a Kendo.button underneath ?

 

<h3>Telerik UI for ASP.NET MVC PanelBar</h3>
<br />
 
@(Html.Kendo().PanelBar()
    .Name("IntroPanelBar")
    .Items(items =>
    {
        items.Add()
            .Text("Getting Started")
            .Selected(true)
            .Expanded(true)
            .Content(@<text>
                Testing

    //button here

            </text>);
 
        items.Add()
            .Text("Add NuGet packages and jump-start your coding")
            .Content(@<text>
                <p style="padding:0 1em">NuGet makes it easy to install and update free libraries and tools.
                <a href="http://go.microsoft.com/fwlink/?LinkId=245153">Learn more…</a></p>
            </text>);
        items.Add()
            .Text("Find Web Hosting")
            .Content(@<text>
                <p style="padding:0 1em">You can easily find a web hosting company that offers the right mix of features
                and price for your applications.
                <a href="http://go.microsoft.com/fwlink/?LinkId=245157">Learn more…</a></p>
            </text>);
    })
)

 

Alexander Popov
Telerik team
 answered on 30 Jun 2015
1 answer
139 views

dear community,

 I'm facing the following issue right now:

 within my TreeView it should be possible, that every node and all its children can be copied within the same tree. Therefore I've setup a button which calls a function that tries to copy the node + its children.

The function looks like this:

function CopyTreeViewItems() {
        var treeview = $('#treeview').data('kendoTreeView');
        var selectedNode = treeview.select();
 
        var data = treeview.dataItem(selectedNode);
 
        var newData = {
            id: GenerateGuid(),
            Name: data.Name + "tmp"
        };
 
        treeview.insertAfter(newData, selectedNode);
        var parentItem = treeview.dataItem(treeview.findByText(newData.Name)); //<--- this part is returning 'undefined'
 
            if (data.hasChildren) {
                var children = data.children.data();
 
                for (var i = 0; i < children.length; i++) {
                    var add = { id: GenerateGuid(), Name: children[i].Name };
                    treeview.append(add, parentItem);
                }
            }
}

The parent node is copied without any problems. If there are children of a parent node I'm not able to append them to the corresponding new parent.

Any advices?

Kind regards

Tom

Thomas
Top achievements
Rank 2
 answered on 30 Jun 2015
16 answers
2.1K+ views
Dear Telerik Team!
I've got an essential problem updating a decimal value in a grid.

The model property is annotated wird a weight datatype attribute


        [DataType("Weight")]
        public decimal WeightGross { get; set; }

And the Editortemplate for weight is this:

"
model decimal

@(Html.Kendo().NumericTextBoxFor(m => m)
      .Spinners(false)
)
"

The Problem ist the following: When the culture ist set to "de-DE" the value cannot be correctly updated. The decimal separator is ignored!
If I edit the grid row and enter e.g. '3,25' following happens:
- If I press Tab to go to the next colum the value is correctly shown as '3,25'
- But If I click Update, the value submitted to the controller is 325!

I think this has s.th. to do with the fact that the decimal separator is ',' and not '.' with "de" culture.
If I change the culture to "en" and use '.' as decimal separator it works.
Am I missing s.th or is this a bug in the framework?

brgds
Malcolm Howlett

p.s. If I omit the Datatype annotation it does not get better:
 - I can use ',' as the decimal separator in edit mode
 - but after moving to the next column the value is displayed with '.' decimal separator
- When submittin the decimal separator is still ignored. 3,25 (3.25) becomes 325.
License
Top achievements
Rank 1
 answered on 29 Jun 2015
4 answers
163 views

Configuration :

Main page with grid, editable.Mode(GridEditMode.PopUp) 

This Popup page also have grid with PopUp mode, last Popup page have Treeview with property .Checkboxes(true) 

This popup windows newer appear. 

To fix the situation have to delete .Checkboxes property  from TreeView . As workaround delete Checkboxes  and use TemplateId with scripted template and .ToClientTemplate for treeview. 

But this situation definitely Kendo ui bug, and have to be fixed

 

Alex Gyoshev
Telerik team
 answered on 29 Jun 2015
4 answers
101 views

Hi,

 

I have a grid inline with two fields "OrigenId" and "DestiID". These fields uses foreignkey and two templates named "GetOrigenOnPlanning" and "GetDestiOnPlanning". Now I explaind to you that I need, the data inside in template will be different in function if user selects update or create. The problem is I don't find a event is traggered before the data are inserted in dropboxlist, I tested with event edit or event push of the datasource object.

 

GRID

 

@(Html.Kendo().Grid<ExpeditionViewModel>()
            .Name("expedition")
            .HtmlAttributes(new { style = "margin-bottom:10px;" })
            .Scrollable()
            .ToolBar(t =>
            {
                if (User.IsInRole("Modify"))
                {
                    t.Create().Text("Afegir Expedicio");
                }
            })
            .Columns(columns =>
            {
                columns.Bound(f => f.ExpeditionID).Width(90);
                columns.Bound(f => f.Data).Width(100);
                columns.ForeignKey(f => f.OrigenID, (System.Collections.IEnumerable)ViewBag.Centres, "ContactID", "Nom").Width(120).EditorTemplateName("GetOrigenOnPlanning");
                columns.ForeignKey(f => f.DestiID, (System.Collections.IEnumerable)ViewBag.Centres, "ContactID", "Nom").Width(120).EditorTemplateName("GetDestiOnPlanning");
                columns.ForeignKey(f => f.VehicleID, (System.Collections.IEnumerable)ViewBag.Vehicles, "VehicleID", "Matricula").Width(110).EditorTemplateName("CustomGridForeignKey");
                columns.ForeignKey(f => f.XoferID, (System.Collections.IEnumerable)ViewBag.Xofers, "PersonID", "Nom").Width(200).EditorTemplateName("CustomGridForeignKey");
                if (User.IsInRole("Modify"))
                {
                    columns.Command(commands =>
                    {
                        commands.Edit();
                        commands.Destroy();
                    });
                }
            })
            .Editable(e => e.Mode(GridEditMode.InLine))
            .Events(e => e
                .Change("onChange")
                .Edit("onEdit")
                )
            .Sortable()
            .Selectable()
            .Pageable(pageable => pageable.Refresh(true))
            .Navigatable()
            .Filterable()
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(20)
                .Model(m =>
                {
                    m.Id(f => f.ExpeditionID);
                    m.Field(f => f.ExpeditionID).Editable(false);
                    m.Field(f => f.Data).DefaultValue(ViewBag.date);
                    //m.Field(f => f.OrigenID).DefaultValue(ViewBag.CentreUsuari);
                    //m.Field(f => f.DestiID).DefaultValue(ViewBag.CentreUsuari);
                })
                .Events(e => e
                    .Error(@<text>
                        function (e) {
                        onError(e, "expedition");
                        }
                    </text>)
                    .Push("onPush")
                )
                .Read("Read", "Planning", new { date = ViewBag.date })
                .Create("Create", "Planning")
                .Update("Update", "Planning")
                .Destroy("Destroy", "Planning")
            )
        )
 
 

TEMPLATES

 

@model object
           
@(
 Html.Kendo().DropDownListFor(m => m)
    .Name("OrigenID")
    .DataTextField("Nom")
    .DataValueField("ContactID")
    .ValuePrimitive(true)
    .AutoBind(true)
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("SearchCentres", "Productors", new { area = "Comercial" }).Data("filterCentres");
        })
        .ServerFiltering(true);
    })
)
 
@model object
 
@(
 Html.Kendo().DropDownListFor(m => m)
    .Name("DestiID")
    .DataTextField("Nom")
    .DataValueField("ContactID")
    .ValuePrimitive(true)
    .AutoBind(true)
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("SearchCentres", "Productors", new { area = "Comercial" }).Data("filterCentres");
        })
        .ServerFiltering(true);
    })
)
function filterCentres() {
         
        return {
            contactCreate : isCreate
        };
    }

Code Event Edit and Push

var isCreate;
    function onPush(e) {
        if (e.type == "update") {
            isCreate = false;
        } else {
            if (e.type == "create")
                isCreate = true;
        }
    }
 
    function onEdit(e) {
 
        if (!e.model.isNew()) {
            isCreate = false;
 
            //$("#expedition tbody [data-role=dropdownlist]").each(function () {
            //    var ddl = $(this).data("kendoDropDownList");
            //    if (ddl) {
            //        ddl.options.optionLabel = ddl.value;
                    //ddl.refresh();
                    //ddl.Value("");
            //    }
            //})
 
        } else {
            isCreate = true;
             
            $("#expedition tbody [data-role=dropdownlist]").each(function () {
                var ddl = $(this).data("kendoDropDownList");
                if (ddl) {
                    ddl.options.optionLabel = "-Select Please-";
                    ddl.refresh();
                    ddl.value("");
                }
            })
        

 

 

Thanks in advance.

 

Xavier de la Rubia.

Xavier
Top achievements
Rank 1
 answered on 29 Jun 2015
2 answers
355 views

I have an IE problem with caching that i've seen many different places.  My grid works fine on chrome/firefox, and it loads fine on IE.  but if i add a new row set of data, the IE grid refresh doesn't show it.  It's caching and I don't have a way to turn it off.  The options i've seen on your site are:

  1. set output cache to nostore ( http://www.sliqtools.co.uk/blog/net/asp-net-mvc-disable-cache-to-keep-ajax-working-ok/ ) , but this option is ONLY available in the MVC controller, not Web API.
  2. use cache:false (https://stackoverflow.com/questions/14975103/how-to-disable-read-request-cache-in-kendo-ui-data-source).  This option isn't available as an MVC wrapper though.  
  3. use HttpPost instead of HttpGet ( http://www.telerik.com/forums/prevent-ajax-caching-on-read ) .  This option actually does work, but it breaks paging.  For some reason it shows ALL rows in the grid, but still shows the paging at the bottom as if it was only showing 10 rows.  Very odd, and totally broken (clicking on any of the paging buttons does nothing).

Are there any other options out there for an MVC Wrapper, Web API datasource that can't use HttpPost?  

BRAD
Top achievements
Rank 1
 answered on 26 Jun 2015
1 answer
394 views

I've searched around but haven't found a concise example for this yet.

I have an object graph with nested data such as coming from Entity Framework
Parent
    Multiple Children
          Multiple Children

I need to provide the user a way to modify/create the parent as well as the children in as simple a way as possible in a single UI. How can I accomplish this using Kendo MVC with MS MVC 5? If possible I'd rather not manually create a ViewModel and have to do translation between the object graph and the ViewModel. If that's the only solution then I guess that's what I have to do but I was hoping to be able to use the EF model directly. Any suggestions are greatly appreciated.

Dimo
Telerik team
 answered on 26 Jun 2015
1 answer
102 views

Hello,

Is it possible to drag & drop multiple items from one listview to another at once?

 

Petyo
Telerik team
 answered on 26 Jun 2015
2 answers
274 views

I am not sure when this window stopped working, it was working before. I have made a test and get an undefined error.
We have published a new version of site and this error is live, any ideas I am under pressure to fix this, thanks
Example is on VB

@code
    Layout = Nothing
End Code
 
<link href="~/content/kendo/kendo.common.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.mobile.all.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.dataviz.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.default.min.css" rel="stylesheet" />
<link href="~/Content/kendo/kendo.dataviz.default.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.metro.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.default.mobile.min.css" rel="stylesheet" />
<script src="~/Scripts/jquery-2.1.4.js"></script>
<script src="~/Scripts/Kendo/kendo.all.min.js"></script>
 
<script src="~/scripts/kendo/jszip.min.js"></script>
    <script src="~/scripts/kendo/kendo.all.min.js"></script>
        <script src="~/scripts/kendo/kendo.aspnetmvc.min.js"></script>
        <script src="~/scripts/kendo/kendo.modernizr.custom.js"></script>
 
@code
    Dim AlertWindow As Kendo.Mvc.UI.Window = Html.Kendo.Window().Name("AlertWindow").
           Visible(False).Actions(Function(actions) actions.Pin().
                                      Refresh().
                                      Maximize().
                                      Close()).
                                  Width(400).
                                  Title("Warning").
                                  Pinned(True)
    AlertWindow.Render()
End Code
 
 
 
 
 
<script>
    alertWindow("ffffff")
    function alertWindow(message) {
        var win = $("#AlertWindow").data("kendoWindow");
        alert(win)
        win.content(
          "<div class=\"alert alert-warning\">" + message + "</div>"
        );
 
        win.center().toFront().open().restore();
        $("#AlertWindow").closest(".k-widget").css({
            top: 100,
 
        });
    }
 
</script>

Alan Mosley
Top achievements
Rank 1
 answered on 26 Jun 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
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?