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

[Solved] Images disappear after edit - see example

1 Answer 51 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.
niko
Top achievements
Rank 1
niko asked on 04 Jan 2012, 05:41 PM
If I edit a row - after accepting the edit - the images are not displayed anymore - after clicking the refresh button images are visible again.

Thanks for any help.
Nikolaus

  <div>
      @(Html.Telerik().Grid<Wiscon.WebShop.WebUI.Models.WebOrderSearchModel>()
          .Name("OrderGrid")
          .Localizable("de-DE")
          .DataKeys(keys => keys.Add(c => c.ID))
          .DataBinding(dataBinding => dataBinding.Ajax()
              .OperationMode(GridOperationMode.Server)
              .Select("OrderSearchDataBinding", "Product")
              .Update("OrderUpdate", "Product")
              .Delete("OrderDelete", "Product")
            )
          .Columns(columns => {
            columns.Bound(o => o.ID).Hidden(true);
            columns.Bound(o => o.FileNameThumbnail).Title(" ").ReadOnly(true)
              .ClientTemplate("<img alt='<#= FileNameThumbnail #>' src='" + Url.Content("~/Content/ImagesProdukte/") + "<#= FileNameThumbnail #>' width='65px;' />");
            columns.Bound(o => o.Description).Title("Artikel").ReadOnly(true)
              .ClientTemplate("" + Html.ActionLink("<#= Description #>", "ProductDetail", "Product", new { id = "<#= ProductID #>" }, new { @class = "ProductDetailLink" }));
            columns.Bound(o => o.Price).Title("Preis").Format("{0:n}").ReadOnly(true);
            columns.Bound(o => o.Amount).Title("Anzahl").ReadOnly((ViewBag.PayURL.Length == 0 ? false : true));
            columns.Command(commands => {
              commands.Edit().ButtonType(GridButtonType.Image);
              commands.Delete().ButtonType(GridButtonType.Image);
            }).Width(90).Title("Aktion");
          })
          .Pageable(paging =>
            paging.Position(GridPagerPosition.Top)
                  .Style(GridPagerStyles.NextPreviousAndNumeric)
                  .PageSize(10)
          )
          .Sortable()
          .Scrollable(c => {
            c.Enabled(false);
            c.Height("Auto");
          })
      )
  </div>

1 Answer, 1 is accepted

Sort by
0
Max
Top achievements
Rank 1
answered on 24 Jan 2012, 09:28 PM
I am having the same problem. Please someone shed some light here :)
Thanks!

PS: Update: using .ReadOnly(true) for the specific bound field fixed my problem.
Tags
Grid
Asked by
niko
Top achievements
Rank 1
Answers by
Max
Top achievements
Rank 1
Share this question
or