This question is locked. New answers and comments are not allowed.
Hi,
I can't able to use the DateTime type as a datakey. I am going to use Command.Delete and i want the DateTime key on the action result for the delete but the action result is not getting triggered.
If i changed the type from datetime to string the actionmethod is triggered and the value is obtained in the parameter. If its datetime the action method is not triggered.
I have attached my code below,
The above method is not triggered if the starttime type in the Model is System.DateTime.
My Another query is i can't use Delete Command alone. I have to use Edit along with Delete which i don't want in this scenario.
Thanks,
Pradeep.
I can't able to use the DateTime type as a datakey. I am going to use Command.Delete and i want the DateTime key on the action result for the delete but the action result is not getting triggered.
If i changed the type from datetime to string the actionmethod is triggered and the value is obtained in the parameter. If its datetime the action method is not triggered.
I have attached my code below,
<%= Html.Telerik().Grid<TimeSlot>() .Name("TimeSlotList") .DataKeys( keys => { keys.Add(o => o.Id).RouteKey("id"); keys.Add( o => o.TimeZone).RouteKey("timezone"); keys.Add( o => o.StartTime).RouteKey("starttime"); } ) .Columns(colums => { colums.Bound(o => o.Id); colums.Bound(o => o.TimeZone); colums.Bound( o => o.StartTime ); colums.Bound( o => o.EndTime ); colums.Bound( o => o.Booked ); colums.Bound( o => o.Transaction.TransactionNumber ); colums.Command(commands => { commands.Edit(); commands.Delete(); }).Title("Commands"); }) .DataBinding(dataBinding => dataBinding.Ajax().Select("Ajax_Index", "TimeSlot") .Delete("Ajax_Delete", "TimeSlot") .Update("Ajax_Edit","TimeSlot") ) .Scrollable( scrolling => scrolling.Height( 600 ) ) .Sortable() .Pageable(page => page.PageSize(13)) .Filterable() .Groupable() %>[AcceptVerbs(HttpVerbs.Post)] [GridAction] public virtual ActionResult Ajax_Delete(string id, string timezone, DateTime starttime) { var timeslotList = DeleteTimeSlot(); return View(new GridModel(timeslotList.ToList())); }The above method is not triggered if the starttime type in the Model is System.DateTime.
My Another query is i can't use Delete Command alone. I have to use Edit along with Delete which i don't want in this scenario.
Thanks,
Pradeep.