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

[Solved] CRUD ToolBar Grid

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marlos
Top achievements
Rank 1
Marlos asked on 18 Nov 2010, 05:17 PM
Is there a way to do CRUD using the ToolBar of the Grid?

My code:


<%= Html.Telerik().Grid(Model)
        .Name("LinksGrid")    
        .ToolBar(commands =>
        {
            commands.Insert().ButtonType(GridButtonType.Text);
            commands.Custom().Action("Editar", "Links").Text("Edit");
            commands.Custom().Action("Deletar", "Links").Text("Delete");
        })
        .DataKeys(keys =>
        {
            keys.Add(p => p.Id);
        })
        .DataBinding(dataBinding => dataBinding
            .Ajax()
                .Select("Listar", "Links")
                .Insert("Adicionar", "Links")
                .Update("Editar", "Links")
                .Delete("Deletar", "Links")
        )
        .Columns(columns =>
        {
            columns.Bound(o => o.Id);
            columns.Bound(o => o.Nome);
            columns.Bound(o => o.Endereco).Title("Endereço");
            columns.Bound(o => o.Descricao).Title("Descrição");
            columns.Bound(o => o.Ativo);
        })
        .Pageable()
        .Scrollable()
        .Sortable()
        .Pageable()
        .Selectable()
        %>


The attached grid.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Nov 2010, 10:27 AM
Hi Marlos,

Find attached a sample application which shows how to achieve this scenario.

Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Marlos
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or