Paste data into grid

3 posts, 0 answers
  1. Kendo UI Grid
    Kendo UI Grid avatar
    2 posts
    Member since:
    Sep 2016

    Posted 14 Oct Link to this post

    Hello, I want to paste data into grid, please revise my code. Thanks.

     

    @(Html.Kendo().Grid<ConfigurationModel>()
            .Name("grid")
            .Events(e => e.Edit("onGridEdit"))
            .AutoBind(false)
            .Columns(columns =>
            {
                columns.Bound(c => c.A);
                columns.Bound(c => c.B);
                columns.Bound(c => c.C);
                columns.Command(command => { command.Edit(); command.Destroy(); }).Width(250);
            })
            .ToolBar(toolbar => { toolbar.Create();  toolbar.Excel(); })
            .Editable(editable => editable.Mode(GridEditMode.InLine))
            .HtmlAttributes(new { style = "height: 550px;" })
            .Sortable()
            .Pageable(pageable => pageable
                 .Refresh(true)
                 .PageSizes(true)
                 .ButtonCount(15))
            .Excel(excel => excel
                .FileName("Export.xlsx")
                .Filterable(true)
                .ProxyURL(Url.Action("Excel_Export_Save", "Grid"))
            )
            .DataSource(dataSource => dataSource
                .Ajax()
                .Events(events => events.Error("grid_error"))
                .Model(model =>
                {
                    model.Id(p => p.A);
                   
                })
                .Create(create => create
                    .Action("Create", "Configuration"))
                .Read(read => read
                    .Action("Read", "Configuration")
                 )
                .Update(update => update
                    .Action("Update", "Configuration")
                )
                .Destroy(destroy => destroy
                    .Action("Destroy", "Configuration"))
                .PageSize(10)
            )

  2. Kendo UI Grid
    Kendo UI Grid avatar
    2 posts
    Member since:
    Sep 2016

    Posted 14 Oct Link to this post

    The current sample code is using hard code ----- dataSource:[Name: "John Doe", Age: 33]

    and $("#grid").kendoGrid()

  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1800 posts

    Posted 18 Oct Link to this post

    Hello,

    You can attach the event handlers to the Grid element in the same manner with the MVC wrappers when the elements are rendered on the page:
    $("#grid").on('focusin', ...
    ...

    As for the dataSource, you will have to modify it according to your exact scenario.



    Regards,
    Konstantin Dikov
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top