1

I am getting error when I am giving this line

columns.Bound(c => c.BusinessTypeName).HeaderTemplate("").Title(@Helper.GetResourceString("lbl_DealerName")).ClientTemplate(@"<div style='text-align: center;'> #if(\\#=BusinessTypeName\\# == null || \\#=BusinessTypeName\\# == '') {# \\#=Name\\# #}else{# <a style='text-decoration: underline;' href='" + Url.Action("DealerBusinessTypeEditRedirect", "Dealer", new { dealerId = "\\#=Id\\#" }) + "' title='" + @Helper.GetResourceString("msg_Edit") + "'>\\#=Name\\#</a> #}# </div>").Width(Settings.GridColumnMaxWidth);





  @(Html.Kendo().Grid<DealerDto>()
                          .Name("ViewDealers")
                          .Columns(columns =>
                          {
                          columns.Bound(c => c.Id).Visible(false);
                          columns.Bound(c => c.BusinessTypeName).HeaderTemplate("").Title(@Helper.GetResourceString("lbl_DealerName")).ClientTemplate(@"<div style='text-align: center;'> #if(BusinessTypeName == null || BusinessTypeName == '') {# #=Name# #}else{# <a style='text-decoration: underline;' href='" + Url.Action("DealerBusinessTypeEditRedirect", "Dealer", new { dealerId = "#=Id#" }) + "' title='" + @Helper.GetResourceString("msg_Edit") + "'>#=Name#</a> #}# </div>").Width(Settings.GridColumnMaxWidth);
                          columns.Bound(c => c.CustomerCode).Title(@Helper.GetResourceString("lbl_CustomerCode")).Width(Settings.GridColumnMaxWidth);
                          columns.Bound(c => c.BusinessTypeName).Title(@Helper.GetResourceString("lbl_BusinessType")).Width(Settings.GridColumnMaxWidth);
                          columns.Bound(c => c.GSTNumber).Title(Helper.GetResourceString("lbl_GSTNumber")).Width(Settings.GridColumnMaxWidth);
                          columns.Bound(t => t.IsActive).HeaderTemplate("").Title(@Helper.GetResourceString("msg_Status")).ClientTemplate(@"<div style='text-align: center;'> #if(IsActive == false) { #"
                           +" <a  title='" + @Helper.GetResourceString("msg_Inactive") + "'><i class='icon-cancel-square2 faicon-red' ></i></a>   #}else{#<a title='" + @Helper.GetResourceString("msg_Active") + "'><i  class='icon-checkbox-checked2 faicon-green' ></i></a> #}# </div>").Width(Settings.GridButtonColumnWidth);
                          columns.Template(t => t.Id).HeaderTemplate("").Title(@Helper.GetResourceString("lbl_Action"))
                          .ClientTemplate("<div style='text-align: center;'><a class='icon-pencil cursor-pointer' href='" + Url.Action("DealerEditRedirect", "Dealer", new { dealerId = "#=Id#" }) + "' ></a><a style='padding-left: 4px;' class='icon-eye cursor-pointer' onclick=\"openDealerDetails('#=Id#')\"></a></div>").Width(Settings.GridButtonColumnWidth); })
                          //.Editable(editable => editable.Mode(GridEditMode.InCell))
                          .NoRecords(e => e.Template(@Helper.GetResourceString("msg_NoRecordsFound")))
                          .Filterable(filter => filter.Mode(GridFilterMode.Row))
                          .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
                          .Pageable(pageable => pageable.Refresh(true).PageSizes(Settings.GridPageSizes))
                          .Scrollable(s => s.Enabled(true).Height("auto"))
                          .ClientDetailTemplateId("template")
                          .Events(events => events.DataBound("onDealerListDataBound"))
                          .Reorderable(reorder => reorder.Columns(true))
                          .DataSource(dataSource => dataSource
                          .Ajax()
                          .PageSize(Settings.DefaultPageSize)
                          .Model(model =>{model.Id(p => p.Id);})
                          .ServerOperation(true)
                          .Read(read => read.Action("GetDealerListAsync", "Dealer"))))
                    <script id="template" type="text/kendo-tmpl">
                        @(Html.Kendo().Grid<DealerDto>()
                              .Name("grid_#=Id#")
                              .Columns(columns =>
                              {
                                  columns.Bound(c => c.Id).Visible(false);
                                 // columns.Bound(c => c.Name).Title(@Helper.GetResourceString("lbl_DealerName")).Width(Settings.GridColumnMaxWidth);
                                  //  columns.Bound(c => c.BusinessTypeName).HeaderTemplate("").Title(@Helper.GetResourceString("lbl_DealerName")).ClientTemplate(@"<div style='text-align: center;'> #if(BusinessTypeName == null || BusinessTypeName == '') {# #=Name# #}else{# <a style='text-decoration: underline;' href='" + Url.Action("DealerBusinessTypeEditRedirect", "Dealer", new { dealerId = "#=Id#" }) + "' title='" + @Helper.GetResourceString("msg_Edit") + "'>#=Name#</a> #}# </div>").Width(Settings.GridColumnMaxWidth);
                                  columns.Bound(c => c.BusinessTypeName).HeaderTemplate("").Title(@Helper.GetResourceString("lbl_DealerName")).ClientTemplate(@"<div style='text-align: center;'> #if(\\#=BusinessTypeName\\# == null || \\#=BusinessTypeName\\# == '') {# \\#=Name\\# #}else{# <a style='text-decoration: underline;' href='" + Url.Action("DealerBusinessTypeEditRedirect", "Dealer", new { dealerId = "\\#=Id\\#" }) + "' title='" + @Helper.GetResourceString("msg_Edit") + "'>\\#=Name\\#</a> #}# </div>").Width(Settings.GridColumnMaxWidth);
                                  columns.Bound(c => c.CustomerCode).Title(@Helper.GetResourceString("lbl_CustomerCode")).Width(Settings.GridColumnMaxWidth);
                                  columns.Bound(c => c.BusinessTypeName).Title(@Helper.GetResourceString("lbl_BusinessType")).Width(Settings.GridColumnMaxWidth);
                                  columns.Bound(c => c.GSTNumber).Title(Helper.GetResourceString("lbl_GSTNumber")).Width(Settings.GridOtherColumnWidth);
                                  columns.Bound(t => t.IsActive).HeaderTemplate("").Title(@Helper.GetResourceString("msg_Status")).ClientTemplate(@"<div style='text-align: center;'> #if(IsActive == false) { #"
                                   +" <a  title='" + @Helper.GetResourceString("msg_Inactive") + "'><i class='icon-cancel-square2 faicon-red' ></i></a>   #}else{#<a title='" + @Helper.GetResourceString("msg_Active") + "'><i  class='icon-checkbox-checked2 faicon-green' ></i></a> #}# </div>").Title(@Helper.GetResourceString("msg_Status")).Width(Settings.GridButtonColumnWidth);
                                  columns.Template(t => t.Id).HeaderTemplate("").Title(@Helper.GetResourceString("lbl_Action")).ClientTemplate("<div style='text-align: center;'><a class='icon-eye cursor-pointer' onclick=\"openDealerDetails('\\#=Id\\#')\"></a>  <a class='icon-cross cursor-pointer' onclick=\"deleteDealerDetails('\\#=Id\\#')\"></a></div>").Width(Settings.GridButtonColumnWidth);
                              })
                              .NoRecords(e => e.Template(@Helper.GetResourceString("msg_NoRecordsFound")))
                              .Events(events => events.DataBound("onChildDealerListDataBound"))
                              .DataSource(dataSource => dataSource
                              .Ajax()
                              .PageSize(Settings.DefaultPageSize)
                              .Read(read => read.Action("GetParentByDealersIdAsync", "Dealer", new { DealerId = "#=Id#" }))
                              )
                              .ToClientTemplate())
                    </script>

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.