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

[Solved] bug in ajax grid with no edit command column

0 Answers 80 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.
mahmoud
Top achievements
Rank 1
mahmoud asked on 01 Oct 2011, 03:33 PM
I have an ajax grid wich only allow to Add or Delete records. so editing is not permitted.
After disabling Edit command  , When try to add a new record the submit/cancel buttons aren't shown.
The grid code is :

@model IEnumerable<ResourceBrandViewModel>
@(Html.Telerik().Grid(Model)
        .Name("ResourceBrandsGrid")
               .DataKeys(keys =>
               {
                   keys.Add(c => c.Id);
               })
 
        .Localizable("fa-IR")
          .Columns(columns =>
          {
              columns.Bound(o => o.RowNo).Width(5);
              columns.Command(commands =>
              {
                  commands.Delete().ButtonType(GridButtonType.Image);
              }).Width(10);
              columns.Bound(o => o.Title);
          })
          .NoRecordsTemplate(" ")
            .ToolBar(commands =>
            {
                commands.Insert().ButtonType(GridButtonType.Image);
            })
                .DataBinding(dataBinding =>
                    dataBinding.Ajax()
            .Select("OnFlySelect""Brands"new { flyId = ViewBag.FlyId + 'B', prfx = ViewData.TemplateInfo.HtmlFieldPrefix })
            .Insert("OnFlyCreate""Brands"new { flyId = ViewBag.FlyId + 'B', prfx = ViewData.TemplateInfo.HtmlFieldPrefix })
            .Delete("OnFlyDelete""Brands"new { flyId = ViewBag.FlyId + 'B', prfx = ViewData.TemplateInfo.HtmlFieldPrefix })
                )
         .ClientEvents(o => o
             .OnRowDataBound("OnBrandGridRowDataBound")
                 .OnEdit("OnBrandGridRowEdit"))
             .KeyboardNavigation(o => o.Enabled(false))
         .Footer(true)
    )

any workaround?
Tags
Grid
Asked by
mahmoud
Top achievements
Rank 1
Share this question
or