This question is locked. New answers and comments are not allowed.
I am using 2 DateTimePickers and a submit button in my form.
Outside of my form I am server side binding a grid. When changing dates and posting back the data is returned to the grid as expected and the dates stay as is for the DateTimePickers.
The problem is when I use grouping... as soon as I do, the postback causes the dates to come in as nulls to my action and my default date range is used and the dateTimePickers are returned empty.
Is this a bug in the grouping or am I doing something wrong?
Outside of my form I am server side binding a grid. When changing dates and posting back the data is returned to the grid as expected and the dates stay as is for the DateTimePickers.
The problem is when I use grouping... as soon as I do, the postback causes the dates to come in as nulls to my action and my default date range is used and the dateTimePickers are returned empty.
Is this a bug in the grouping or am I doing something wrong?
<%
using
(Html.BeginForm()){ %>
<fieldset>
<legend>Search By</legend>
<% Html.Telerik().DateTimePicker()
.Name(
"dtpStart"
)
.Format(
"M/d/yyyy h:mm tt"
)
.Render(); %>
<% Html.Telerik().DateTimePicker()
.Name(
"dtpEnd"
)
.Format(
"M/d/yyyy h:mm tt"
)
.Render(); %>
<input type=
"submit"
value=
"Search"
class
=
"t-button t-state-default"
style=
"display:inline-block"
/>
</fieldset>
<%} %>
<% Html.Telerik().Grid(Model).Name(
"Grid1"
).Columns(columns =>
{
columns.Template(c =>
public
ActionResult Search(DateTime? dtpStart, DateTime? dtpEnd)
{
ViewData[
"dtpStart"
] = dtpStart;
ViewData[
"dtpEnd"
] = dtpEnd;
DateTime d =
new
DateTime(1900,1,1,0,0,0);
if
(!dtpStart.HasValue || !dtpEnd.HasValue)
{
dtpStart =
new
DateTime(2009, 10, 27, 0, 0, 0);
dtpEnd =
new
DateTime(2009, 10, 27, 4, 30, 0);
}
int
startStamp = (
int
)dtpStart.Value.Subtract(d).TotalMinutes;
int
endStamp = (
int
)dtpEnd.Value.Subtract(d).TotalMinutes;
decimal
disconnectThreshold = 0;