title | page_title | description | slug | tags | published | position |
---|---|---|---|---|---|---|
Getting and Setting Values |
Getting and Setting Values - RadDateInput |
Check our Web Forms article about Getting and Setting Values. |
raddateinput/features/getting-and-setting-values |
getting,and,setting,values |
true |
3 |
On the server-side, each RadInput control uses a different property to represent its value. The following table lists the property to use to get or set the value of a RadDateInput control:
caption
RadInput Control | Property | Type |
---|
|RadDateInput|SelectedDate, DbSelectedDate (in data-bound context)|Nullable DateTime object|
All of the four RadInput controls including the RadDateInput have the following common properties:
-
The DisplayText property allows you to set the display value from the Server to a different value from the actual value. Similar to the empty message, but shown even if the input is not empty. This text will be cleared once the user changes the input value.
-
The ValidationText is a read-only property which returns the the date in universal format ( “yyyy-MM-dd-HH-mm-ss” )
The RadDateInput control uses the SelectedDate property to get or set its value. The following code examples show how to read the value of one RadDateInput control called "RadDateInput2" and use it to set the value of another, "RadDateInput1".
protected void Page_Load(object sender, EventArgs e)
{
RadDateInput1.SelectedDate = RadDateInput2.SelectedDate;
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
RadDateInput1.SelectedDate = RadDateInput2.SelectedDate
End Sub
function CopyDateValue()
{
var radDateInput1 = $find("<%= RadDateInput1.ClientID %>");
var radDateInput2 = $find("<%= RadDateInput2.ClientID %>");
radDateInput1.set_selectedDate(radDateInput2.get_selectedDate());
}
- [Using Input Controls Inside Data-Bound Controls]({%slug raddateinput/how-to/using-input-controls-inside-data-bound-controls%})