2015-05-20 108 views
-1
// this is my kendo grid , in client template how to write DateTime nowDate = DateTime.Now; this things ... 



//OrderList is my model class 



@(Html.Kendo().Grid<MDA.AppEntities.Orders.OrderList(Model.OrderList) 
//define the name of grid 
       .Name("GridLastOrder") 
    // adding column in kendo grid 
       .Columns(columns => 
       { 
      columns.Bound(c => c.EventConsultStatusID).ClientTemplate(# 
      if (CustomerSource == "+3+" || CustomerSource == "+5+") 
           {# 
            DateTime nowDate = DateTime.Now; 
            TimeSpan spn = nowDate.Subtract(EventLastUpdated); 
            if (spn.Days > 2) 
            {# 
             <a href="+ Url.Action("LPU_CustomerPickedUp", "Operations", new { Ord_ID = "#=Ord_ID#" })"> Patient Picked-Up</a><br /> 
            #} 
           # } 
     }) 
     .Resizable(resizing => resizing.Columns(true)) 
           .Pageable(Page => Page.Refresh(true).PageSizes(true).PreviousNext(true)) 
           .Filterable() 
           .Sortable() 

           .Scrollable() 
           .Groupable() 
           .Reorderable(reorder => reorder.Columns(true)) 
           .DataSource(dataSource => dataSource.Ajax() 
           .ServerOperation(false) 
             ) 



      ) 

回答

0

里面的客户端模板显示的链接,你可以只写JS代码,C#代码不支持

+0

u能告诉我如何写这个东西在客户端模板Re-fill

重新填写合格:@ item.ReOrderDate.ToString(“MM/dd/yyyy”)