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

[Solved] Problem Datapicker In Batch Grid

1 Answer 20 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.
zied
Top achievements
Rank 1
zied asked on 18 Oct 2011, 03:14 PM
hi,
I Use an Editor Template DatePicker in Batch Grid..it work fine but the problem is that i can't set a null value in that column : when i delete the date in the cell in doesn't set as modified...

Editor Template DatePicker
@model DateTime?

@(Html.Telerik().DatePicker()
        .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
        .HtmlAttributes(new { id = ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty) + "_wrapper" })
        
)


********* The Batch Grid  ****************
  @(Html.Telerik().Grid<CollaborateurSocieteVM>()
                                .Name("gridCollaborateurSociete")
                                .Localizable("fr-FR")
                                .Resizable(resizing => resizing.Columns(true))
                                .DataKeys(keys => keys.Add(c => c.CollaborateurSocieteID))
                                .ToolBar(commands =>
                                {
                                    commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new { style = "margin-left:0" });
                                    commands.SubmitChanges().HtmlAttributes(new { id = "btnCollaborateurSociete" });
                                })
                                .DataBinding(dataBinding => dataBinding.Ajax()
                                             .Select("GetCollaborateurSociete", "Collaborateur", new { collaborateurID = ViewBag.CollaborateurID })
                                             .Update("SauvegarderCollaborateurSociete", "Collaborateur", new { collaborateurID = ViewBag.CollaborateurID }))
                                .Columns(columns =>
                                {
                                    columns.Bound(p => p.Societe).Title("Société").ClientTemplate("<#= (Societe==null)? '' : Societe.EntityLibelle  #>").Width(200);
                                    columns.Bound(p => p.Service).Title("Service").ClientTemplate("<#= (Service==null)? '' : Service.EntityLibelle  #>").Width(200);
                                    columns.Bound(p => p.DateDebutCollaborateurSociete).Title("Date d'entrée").Format("{0:dd/MM/yyyy}").Width(150);
                                    columns.Bound(p => p.DateFinCollaborateurSociete).Title("Date de sortie").Format("{0:dd/MM/yyyy}").HtmlAttributes(new { colonneName = "DateFinCollaborateurSociete" }).Width(150);
                                    columns.Bound(p => p.IsSousTraitant).Title("SousTraitant").ClientTemplate("<input type='checkbox' disabled='disabled' name='IsSousTraitant' <#= IsSousTraitant? checked='checked' : '' #> />").Width(30);
                                    columns.Bound(p => p.Facturable).Title("Facturable").Format("{0:p}").Width(50);
                                    columns.Command(commands => commands.Delete().ButtonType(GridButtonType.BareImage)).Width(10);
                                })

                                        .ClientEvents(events => events.OnDataBinding("TelerikGridOnDataBinding").OnEdit("Grid_OnEditCollaborateurSociete").OnSave("Grid_OnSaveCollaborateurSociete").OnSubmitChanges("Grid_OnSubmitChangesSocieteCollaborateur").OnError("Grid_onError"))
                                .Editable(editing => editing.Mode(GridEditMode.InCell).DefaultDataItem(new CollaborateurSocieteVM()))
                                .Pageable(paging => paging.PageSize(2))
                                .KeyboardNavigation()
                                .Sortable(sorting => sorting.OrderBy(order => order.Add(o => o.DateDebutCollaborateurSociete).Descending()))
                 )
    </text>)
              .Expanded(true);
       })

       .Render();             

1 Answer, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 09 Aug 2012, 07:24 AM
Anyone found a solution to this?

Regards, 

Mark.
Tags
Grid
Asked by
zied
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or