or
I have a UI which needs filtering activated.
The scrum story reads, "As a user I want to filter grid rows using calendar controls to select a start date and an end date."
There are two columns in the grid: Job Start, and Job End. I need to apply the following filter logic:
JobStart >= calendarStartDate AND JobEnd < calendarEndDate.
The routine executes in the event handler of the "apply filter" button.
Can someone please tell me what I am doing wrong?
| protected void UpdateButton_OnClick(object sender, EventArgs args) |
| { |
| //First attempt was to directly edit the filter expression |
| //this._jobReportsSummaryGrid.Grid.MasterTableView.FilterExpression = string.Format("[JobStart] >= '{0}' AND [JobEnd] < '{1}'", _startDateCalendar.SelectedDate, _endDateCalendar.SelectedDate); |
| //When that didn't work I added this |
| this._jobReportsSummaryGrid.Grid.AllowFilteringByColumn = true; |
| GridColumn JobStartColumn = this._jobReportsSummaryGrid.Grid.MasterTableView.GetColumnSafe("JobStart"); |
| JobStartColumn.CurrentFilterFunction = GridKnownFunction.GreaterThanOrEqualTo; |
| JobStartColumn.CurrentFilterValue = _startDateCalendar.SelectedDate.Value.Date.ToString("MM/dd/yyyy"); |
| GridColumn JobEndColumn = this._jobReportsSummaryGrid.Grid.MasterTableView.GetColumnSafe("JobEnd"); |
| JobEndColumn.CurrentFilterFunction = GridKnownFunction.LessThan; |
| JobEndColumn.CurrentFilterValue = _startDateCalendar.SelectedDate.Value.Date.ToString("MM/dd/yyyy"); |
| //...and when that didn't work, I came here |
| } |
| function toggleTreeRows(gridId,rowId) { |
| var masterTable = $find(gridId).get_masterTableView(); |
| var rows = masterTable.get_dataItems(); |
| for (var i = 0; i < rows.length; i++){ |
| var row = rows[i]; |
| if (rowId == row.get_element().getAttribute('lineage')){ |
| alert(row.get_display()); |
| break; |
| } |
| } |
| } |
| <input onclick="FullScreen()" type="button" value="MEDIA_WARNING_FULLSCREEN" id="btnFullScreen" runat="server" /> |
| <input onclick="PauseMe()" type="button" value="MEDIA_PAUSE" id="btnPause" runat="server" /> |
| <input onclick="StopMe()" type="button" value="MEDIA_STOP" id="btnStop" runat="server" /> |