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

[Solved] Calender Not Opening in Grid

0 Answers 26 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gurunath
Top achievements
Rank 1
Gurunath asked on 11 Oct 2011, 08:42 PM

I have added a datetime picker in the telerik grid. But the calender is not opening.
Please let me know if anything is missing or any Javascript needs to be written for this.



@(Html.Telerik().Grid<

 

FormStaff>()

 

.Name(

 

"faFAAs")

 

.DataKeys(k =>

{

k.Add(m => m.StaffID);

})

.DataBinding(dataBinding =>

{

dataBinding.Ajax()

.Select(

 

"_Grid_SelectGroupMembers", "Request")

 

.Delete(

 

"Grid_DeleteGroupMembers", "Request");

 

})

.Columns(c =>

{

c.Bound(p => p.StaffID).Visible(

 

false);

 

c.Bound(p => p.LastName);

c.Bound(p => p.FirstName);

c.Bound(p => p.Department);

c.Bound(p => p.Login);

 

c.Template(

@<text>

@(Html.Telerik().DatePicker()

.Name(Model +

 

"_DatePicker")

 

.HtmlAttributes(

 

new { id = Model + "_DatePicker_wrapper" })

 

.Min(

 

DateTime.Today)

 

.Max(

 

DateTime.Today.AddYears(10))

 

.ShowButton(

 

true)

 

.Value(

 

DateTime.Today.AddYears(1)).ToHtmlString())

 

 

}

</text>

)

.Title(

 

"Expiration Date")

 

.ClientTemplate((Html.Telerik().DatePicker()

.Name(Model +

 

"_DatePicker")

 

.Min(

 

DateTime.Today)

 

.Max(

 

DateTime.Today.AddYears(10))

 

.ShowButton(

 

true)

 

.Value(

 

DateTime.Today.AddYears(1)).ToHtmlString()))

 

.Width(20);

c.Command(commands =>

{

commands.Delete().ButtonType(

 

GridButtonType.BareImage);

 

});

}

)

.Pageable()

.Sortable()

.Filterable()

 

)

Tags
General Discussions
Asked by
Gurunath
Top achievements
Rank 1
Share this question
or