Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Client Template in grid column

$
0
0

Hi Everybody,

 I have a problem using the grid in asp.net mvc and Telerik for asp.net mvc.

 The Client template works fine when entering information and fine display a DateTimePicker.

  But when I leave the field is become empty instead of the Value choosed in the DateTimePicker.
    Do you have any suggestions?

<P>@(Html.Kendo().Grid<​Object.Clubs>().BindTo(Model.​Clubs).Name("Clubs")<BR>.ToolBar(configurator
=><BR>                        {<BR>                           
configurator<BR><BR>.Create();<BR>                        })<BR><BR>.Editable(e
=>
e.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Bottom))<BR>.Events(e
=> e.Edit("onEditItem")).Events(e =>
e.Save("onSaveItem"))<BR>.Columns(columns =><BR>                        {<BR>
                           columns<BR><BR>.Bound(m =>
m.​ClubName).EditorTemplateName("​RelatedClubs").ClientTemplate("#= ​ClubName#"
+<BR>"<inputtype='hidden'name='Clubs[#= indexClub(data)#].​ClubName'
value='#= ​ClubName#'/>"<BR>                            );<BR>              
             columns</P>
<P><BR>.Bound(m => m.EndDate).Width(150).Encoded(true).ClientTemplate("#
if(EndDate != null){ kendo.toString(kendo.parseDate(EndDate,'dd/MM/yyyy'), '" +
"dd-MM-yyyy" + "') } else { kendo.toString('') } #" +<BR>"<input
type='hidden'name='Clubs[#= index​Club(data) #].EndDate'value='#=
ConvertDate(​EndDate) #' />").Format("{0: dd-MM-yyyy}");<BR>                 
          columns<BR><BR>.Command(m => m.Destroy()).Width(100);<BR>          
             })<BR><BR>.DataSource(dataSource => dataSource.Ajax()<BR>.Read(r
=> r.Action("​ClubsRead", "Model"))<BR>.Model(model =><BR>                
       {<BR>                            model<BR><BR>.Id(p => p.Id);<BR>     
                  })<BR>                        )<BR><BR>)</P>
 

Best Regards

  Lars


Viewing all articles
Browse latest Browse all 94857

Latest Images

Trending Articles



Latest Images