This is a migrated thread and some comments may be shown as answers.

How to Add, Edit and Delete

2 Answers 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
King Wilder
Top achievements
Rank 2
King Wilder asked on 08 Jan 2012, 07:35 PM
I've seen the examples where you can modify the data IN the Grid.  I can't do this since I'm displaying only a few columns in the grid of all the columns available for the data I want to add, edit or delete. So I need to use the standard way of doing this which involves a link in the grid which redirects to a separate view that contains all the fields.

How do I add links to the Grid so I can redirect to a different page?

I would also be interested in knowing if it's possible to have the form in a modal Popup over the Grid, but one thing at a time.

This is a sample of my code:

<div id="expensegrid">
</div>
<script type="text/javascript">
    $(function () {
        $("#expensegrid").kendoGrid({
            dataSource: {
                serverPaging: false,
                serverSorting: true,
                pageSize: 10,
                transport: {
                    read: {
                        url: '@Url.Action("ExpenseListJson","Expense")',
                        dataType: 'json'
                    }
                },
                error: function (e) {
                    alert(e);
                }
            },
            height: 250,
            sortable: true,
            pageable: true,
            columns: ["CategoryName", "VendorName", "Amount"]
        });
 
    });
</script>

I don't think I can add them in the columns property.  Any suggestions on how to do this is appreciated.

Thanks,

King Wilder

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 09 Jan 2012, 02:34 PM
Hello,

You may use a column template to insert a link into a Grid's column as shown in the following jsFiddle sample:



Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
King Wilder
Top achievements
Rank 2
answered on 09 Jan 2012, 05:29 PM
Perfect!  Thanks, that was exactly what I needed!
Tags
Grid
Asked by
King Wilder
Top achievements
Rank 2
Answers by
Rosen
Telerik team
King Wilder
Top achievements
Rank 2
Share this question
or