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

[Solved] Default Value for DatetimePicker when insert a new Record

0 Answers 21 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.
Chris
Top achievements
Rank 1
Chris asked on 29 Sep 2011, 03:11 PM

Hello,

I have a grid with Ajax Databinding. One column is a datetime field. When the user inserts a new record the Datetimefield should have the actual time as default-value.

I tried it with


<%=Html.Telerik().Grid<DataModel>.Name("Grid")
.Columns(columns =>{
columns.Bound(o=>o.RID)
columns.Bound(o=>o.Date)
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("_Ajax","GridControl"))
.Editable(editing => editing.Mode(GridEditMode.InCell).DefaultDataItem(new DataModel {Date = DateTime.Now}) %>

But with this method I just get the last time when I reload the site. I think I need a JavaScript for load the actual time, but I don“t know on which event I should react.

Thanks for your Help!

Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Share this question
or