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

[Solved] Using Server & Ajax binding together

0 Answers 12 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.
Khanh
Top achievements
Rank 1
Khanh asked on 26 Jun 2012, 02:33 PM
Hi,

I'm trying to supply the model for the first request (to save one Ajax request):
Controller:
public ActionResult Index()
{
    return View(orders);
}
 
[GridAction]
public ActionResult _Select()
{
    return View(new GridModel(orders));
}

View:
@model IEnumerable<Sample.Models.Order>
@(
 Html.Telerik().Grid<Sample.Models.Order>(Model)
        .Name("grid")
        .DataBinding(binding => binding.Ajax()
        .Select("_Select", "Home").Update("_Update", "Home").Delete("_Delete", "Home"))
        .DataKeys(keys => keys.Add(o => o.ID))
        .BindTo(Model)
        .Columns(columns =>
            {
 
                //
                // columns
                //
 
                columns.Command(commands =>
                {
                    commands.Edit().ButtonType(GridButtonType.ImageAndText);
                    commands.Delete().ButtonType(GridButtonType.ImageAndText);
                }).Width(200);

However, the "Command" column is not rendered properly.
Is this a bug or this approach is not supported?
Tags
Grid
Asked by
Khanh
Top achievements
Rank 1
Share this question
or