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

[Solved] Binding Data Input

1 Answer 192 Views
Input
This is a migrated thread and some comments may be shown as answers.
Nyceane
Top achievements
Rank 1
Nyceane asked on 30 Jan 2008, 07:24 PM
ok, it seems that whenever I put a DataInput in a formview or RadGrid template, I can't seem to bind it to one of the date I want to change

<telerik:RadDatePicker ID="OnsetDatePicker" runat="server" 
         Culture="English (United States)" Width="100%" 
SelectedDate='<%# Bind("OnsetDate") %>' >
<DatePopupButton CssClass="radPopupImage_Default" />
<Calendar runat="server" CellAlign="Center" CellVAlign="Middle" DayNameFormat="FirstLetter" FirstDayOfWeek="Default"
          MonthLayout="Layout_7columns_x_6rows" Orientation="RenderInRows" TitleAlign="Center"
          UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False">
</Calendar>
<DateInput runat="server" Width="100%">
</DateInput>
</telerik:RadDatePicker>

they work fine with edit mode, as soon as I put them in insert mode and select a date, the SelectedDate value no longer binds to whatever I need to bind, and in the end I get a null value for the date.

Is there any other Text Field that I can bind to just so that I can get the value from selected date and another field?

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 31 Jan 2008, 08:37 AM
Hello Nyceane,

By default when you insert a new record a null value will be passed to your date picker because there is no date entry available for the newly inserted item.

If you would like to set predefined date (for example today's date) in the picker on initial insertion, intercept the ItemCommand event of the grid (when e.CommandName is RadGrid.InitInsertCommandName) and set the date of your choice as demonstrated here.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Input
Asked by
Nyceane
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or