i wrote code below but it gives "Specified cast is not valid." error.
<radG:GridTemplateColumn HeaderText="Date" SortExpression="Date" UniqueName="Date" ItemStyle-Width="12.5%">
<asp:Label runat="server" ID="lblDate" Text='<%# Eval("Date") %>'></asp:Label>
<radCln:RadDatePicker runat="server" ID="datePicker" SelectedDate='<%# Bind("Date") %>'></radCln:RadDatePicker>
5 Answers, 1 is accepted
Try replacing the SelectedValue property of the RadDatePicker with DbSelectedValue property and then bind it to the DataSource. Rather than using a Template column, a better suggestion would be to use a GridDateTimeColumn in the Grid as shown below, which will allow the user to select a date from the DatePicker in EditMode and display the date in NormalMode.
Do i have to install or upgrade my rad controls?
Did you try with the DbSelectedValue property of the DatePicker as suggested by Princy? I think that should solve the issue. Refer to this KB article. However, to use the GridDateTimeColumn you will have to upgrade to the latest version.
For information on upgrading to later versions go through the following link.
Updating RadControls for ASP.NET to another version or license
I am sorry. Try using DbSelectedDate instead of DbSelectedValue. Also this property will not come along with the intelliscense. You just have to type manually and bind the value. Here is how I implemented it.