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

attempts to set RadTimePicker

1 Answer 27 Views
Input
This is a migrated thread and some comments may be shown as answers.
matt
Top achievements
Rank 1
matt asked on 17 Oct 2008, 04:25 PM
hello,

i am using a RadTimePicker in my RadGrid's EditForm's UserControl. like so:

<Telerik:RadTimePicker id="rdpArrestTime" SelectedDate='<%# Eval("ArrestDateTime") %>' DateInput-DateFormat="HH:mm" Width="97" TimePopupButton-Visible="false" TabIndex="22" Runat="server" /> 


...this doesnt seem to work when the db-value is NULL.

how does one set it?


thanks,
matt

1 Answer, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 17 Oct 2008, 08:29 PM
Hey Matt,

You can use the OnDataBinding event to perform a custom handling of the data...  For example:

<Telerik:RadTimePicker id="rdpArrestTime" SelectedDate='<%# Eval("ArrestDateTime") %>' DateInput-DateFormat="HH:mm" Width="97" TimePopupButton-Visible="false" TabIndex="22" Runat="server" OnDataBinding="CheckNull"/>  

And then in code-behind (here's mind to auto-decode bound data):

    protected void DecodeText(object sender, EventArgs e)  
    {  
        ((RadTimePicker)sender).Text = HttpUtility.HtmlDecode(((Literal)sender).Text);  
    } 

So you'd basically check for null on the data and replace as necessary.
Tags
Input
Asked by
matt
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Share this question
or