5 Answers, 1 is accepted
0
Accepted
Hi,
In order to implement the behavior you can handle the Load event of the RadDateTimePicker and set the appropriate date.
Regards,
Viktor Tachev
Telerik
In order to implement the behavior you can handle the Load event of the RadDateTimePicker and set the appropriate date.
<
telerik:RadDateTimePicker
runat
=
"server"
ID
=
"RadDateTimePicer1"
OnLoad
=
"RadDateTimePicer1_Load"
></
telerik:RadDateTimePicker
>
protected
void
RadDateTimePicer1_Load(
object
sender, EventArgs e)
{
(sender
as
RadDateTimePicker).SelectedDate = DateTime.Today.AddDays(1);
}
Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
Adam
Top achievements
Rank 1
answered on 22 Dec 2017, 10:15 AM
How about if the RadDateTimePicker is inserted in a <GridDateTimeColumn> e.g.
<
telerik:GridDateTimeColumn
DataField
=
"StartDate"
PickerType
=
"DateTimePicker"
SortExpression
=
"StartDate"
UniqueName
=
"StartDate"
/>
How can we set a default datetime for the picker then? I just want to default the picker to NOW()
0
Hello Adam,
If you mean the inserting form, then you can directly use the following property to achieve that:
Alternatively, you can access the generated controls manually:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode
Analogously, for filtering you can also use ItemDataBound event handler:
https://www.telerik.com/support/kb/aspnet-ajax/grid/details/reduce-cell-width-of-radgrid-range-filtering
However, if you want to apply initial filtering to grid columns, you should use the FireCommandEvent method:
https://www.telerik.com/forums/setting-a-filter-in-the-index-changed-event-of-a-drop-down-combo-not-filtering-the-grid#_QnXxSMs5Uq9rddb2JWcWA
I hope this will prove helpful.
Regards,
Eyup
Progress Telerik
If you mean the inserting form, then you can directly use the following property to achieve that:
<
telerik:GridDateTimeColumn
...
DefaultInsertValue
=
"5/5/2015"
>
Alternatively, you can access the generated controls manually:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode
Analogously, for filtering you can also use ItemDataBound event handler:
https://www.telerik.com/support/kb/aspnet-ajax/grid/details/reduce-cell-width-of-radgrid-range-filtering
However, if you want to apply initial filtering to grid columns, you should use the FireCommandEvent method:
https://www.telerik.com/forums/setting-a-filter-in-the-index-changed-event-of-a-drop-down-combo-not-filtering-the-grid#_QnXxSMs5Uq9rddb2JWcWA
I hope this will prove helpful.
Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.
0
Hannah
Top achievements
Rank 1
answered on 25 Apr 2018, 05:22 PM
When I tried implementing the load event of the I got a null reference exception - what am I missing?
0
Hello Hannah,
Generally, the Controls[0] approach should return the generated combo or dropdownlist control:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode
Please note that if you are using Batch editing mode, things a little bit different:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-batch-edit-mode
Regards,
Eyup
Progress Telerik
Generally, the Controls[0] approach should return the generated combo or dropdownlist control:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode
Please note that if you are using Batch editing mode, things a little bit different:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-batch-edit-mode
Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.