or
| ResultsRadNumericTextBox = new RadNumericTextBox(); | |
| ResultsRadNumericTextBox.Type = NumericType.Number; | |
| ResultsRadNumericTextBox.ID = "EntrantHoleResult" + EntrantsResultsData.Table.Rows[DataIndex]["Ordinal"].ToString(); | |
| ResultsRadNumericTextBox.Text = EntrantsResultsData.Table.Rows[DataIndex]["Score"].ToString(); | |
| if (Convert.ToInt32(EntrantsResultsData.Table.Rows[DataIndex]["Ordinal"]) < HoleCount) | |
| { | |
| TargetControl = "ctl00_Content_EntrantResultsEntry1_EntrantHoleResult" + (Convert.ToInt32(EntrantsResultsData.Table.Rows[DataIndex]["Ordinal"]) + 1).ToString() + "_text"; | |
| } | |
| else | |
| { | |
| TargetControl = btnAddEntrantsScores.ClientID; | |
| } | |
| ResultsRadNumericTextBox.TabIndex = (Int16)(Convert.ToInt32(EntrantsResultsData.Table.Rows[DataIndex]["Ordinal"]) + 100); | |
| ResultsRadNumericTextBox.Attributes["onKeyUp"] = "return SendTab('" + TargetControl + "', this, event);"; | |
| ClientIds[DataIndex] = ResultsRadNumericTextBox.ClientID; | |
| ResultsRadNumericTextBox.Width = 14; | |
| ResultsRadNumericTextBox.MinValue = 1; | |
| ResultsRadNumericTextBox.MaxValue = 19; | |
| ResultsRadNumericTextBox.MaxLength = 2; | |
| ResultsRadNumericTextBox.NumberFormat.DecimalDigits = 0; | |
| ResultsRadNumericTextBox.CssClass = EntryNumericTextBoxCellCssClass; | |
| ResultsRadNumericTextBox.ShowSpinButtons = false; | |
| ResultsCell.Text = ResultsRadNumericTextBox.ClientID; | |
| ResultsCell.Controls.Add(ResultsRadNumericTextBox); | |
| ResultsRow.Cells.Add(ResultsCell); |
| private void DrawResultsTable(DataView EntrantsResultsData) | |
| { | |
| if (EntrantsResultsData != null) | |
| { | |
| int HoleCount = EntrantsResultsData.Count; | |
| int RowCount = Convert.ToInt16(HoleCount / 9); | |
| int LeftOverCells = Convert.ToInt16(HoleCount % 9); | |
| int MinCells = HoleCount > 9 ? 9 : HoleCount; | |
| TableRow ResultsRow; | |
| TableCell ResultsCell; | |
| RadNumericTextBox ResultsRadNumericText; | |
| int DataIndex; | |
| for (int i = 0; i < RowCount; i++) | |
| { | |
| ResultsRow = new TableRow(); | |
| ResultsRow.CssClass = EntryRowCssClass; | |
| for (int y = 0; y < MinCells; y++) | |
| { | |
| DataIndex = i * 9 + y; | |
| ResultsCell = new TableCell(); | |
| ResultsCell.Text = EntrantsResultsData.Table.Rows[DataIndex]["Ordinal"].ToString() + ":"; | |
| ResultsCell.CssClass = EntryLabelCellCssClass; | |
| ResultsCell.Attributes["align"] = "right"; | |
| ResultsRow.Cells.Add(ResultsCell); | |
| ResultsCell = new TableCell(); | |
| ResultsCell.CssClass = EntryNumericTextBoxCellCssClass; | |
| ResultsRadNumericText = new RadNumericTextBox(); | |
| ResultsRadNumericText.Type = NumericType.Number; | |
| ResultsRadNumericText.ID = "EntrantHoleResult" + EntrantsResultsData.Table.Rows[DataIndex]["Ordinal"].ToString(); | |
| ResultsRadNumericText.Text = EntrantsResultsData.Table.Rows[DataIndex]["Score"].ToString(); | |
| ResultsRadNumericText.ClientEvents.OnKeyPress = "SendTab(this, 'EntrantHoleResult12',event);"; | |
| ResultsRadNumericText.Width = 14; | |
| ResultsRadNumericText.MinValue = 1; | |
| ResultsRadNumericText.MaxValue = 19; | |
| ResultsRadNumericText.MaxLength = 2; | |
| ResultsRadNumericText.NumberFormat.DecimalDigits = 0; | |
| ResultsRadNumericText.CssClass = EntryTextBoxCssClass; | |
| ResultsRadNumericText.ShowSpinButtons = false; | |
| ResultsCell.Text = ResultsRadNumericText.ClientID; | |
| ResultsCell.Controls.Add(ResultsRadNumericText); | |
| ResultsRow.Cells.Add(ResultsCell); | |
| } | |
| EntrantsResultsTable.Rows.Add(ResultsRow); | |
| } | |
| ResultsRow = new TableRow(); | |
| ResultsCell = new TableCell(); | |
| ResultsCell.Text = "<br />"; | |
| ResultsCell.ColumnSpan = (MinCells * 2); | |
| ResultsRow.Cells.Add(ResultsCell); | |
| EntrantsResultsTable.Rows.Add(ResultsRow); | |
| ResultsRow = new TableRow(); | |
| ResultsCell = new TableCell(); | |
| ResultsCell.ColumnSpan = (MinCells * 2); | |
| ResultsCell.Attributes["align"] = "right"; | |
| Button btnAddEntrantsScores = new Button(); | |
| btnAddEntrantsScores.ID = "btnAddEntrantsScores"; | |
| btnAddEntrantsScores.Attributes["width"] = "50px"; | |
| btnAddEntrantsScores.Text = "Save"; | |
| btnAddEntrantsScores.Click += new EventHandler(this.btnAddEntrantsScores_Click); | |
| Button btnCancelEntrantsScores = new Button(); | |
| btnCancelEntrantsScores.ID = "btnCancelEntrantsScores"; | |
| btnCancelEntrantsScores.Attributes["width"] = "50px"; | |
| btnCancelEntrantsScores.Text = "Cancel"; | |
| btnCancelEntrantsScores.Click += new EventHandler(this.btnCancelEntrantsScores_Click); | |
| ResultsCell.Controls.Add(btnAddEntrantsScores); | |
| ResultsCell.Controls.Add(btnCancelEntrantsScores); | |
| ResultsRow.Cells.Add(ResultsCell); | |
| EntrantsResultsTable.Rows.Add(ResultsRow); | |
| } |
| <script type="text/javascript"> | |
| function SendTab(nextField, strField, evtKeyPress) { | |
| alert("hi"); | |
| var aKey = evtKeyPress.keyCode ? | |
| evtKeyPress.keyCode : evtKeyPress.which ? | |
| evtKeyPress.which : evtKeyPress.charCode; | |
| if (aKey == 13) { | |
| document.getElementById(nextField).focus(); | |
| } | |
| //Check its text | |
| if (aKey == 49 && document.getElementById(strField).value == '') { | |
| return; | |
| } | |
| else { | |
| document.getElementById(nextField).focus(); | |
| } | |
| } | |
| </script> |
| <PagerTemplate> |
| <telerik:RadSlider ID="slider" runat="server" Orientation="Horizontal" Skin="Office2007" |
| AutoPostBack="true" OnValueChanged="Slide_Changed" DataValueField="lblpage" OnClientSlide="clientSlide" /> |
| <label>Pagina </label> |
| <asp:Label ID="SlideLabel" runat="server" /> |
| <asp:Label ID="lblpage" runat="server" Text='<%# " van " + ItemsGridView.PageCount %>' /> |
| </PagerTemplate> |
| protected void ItemsGridView_DataBound(object sender, EventArgs e) |
| { |
| GridViewRow rowPager = ItemsGridView.BottomPagerRow; |
| if (rowPager != null) |
| { |
| RadSlider slider = (RadSlider)rowPager.Cells[0].FindControl("slider"); |
| slider.MinimumValue = 1; |
| slider.MaximumValue = ItemsGridView.PageCount; |
| slider.Value = ItemsGridView.PageIndex + 1; |
| Label sliderLabel = (Label)rowPager.Cells[0].FindControl("SlideLabel"); |
| sliderLabel.Text = (ItemsGridView.PageIndex + 1).ToString(); |
| string script = @" |
| <script type='text/javascript'> |
| function clientSlide(sender, eventArgs) |
| { |
| var myLabel = document.getElementById('" + sliderLabel.ClientID + @"'); |
| myLabel.innerHTML = sender.get_value(); |
| } |
| </script>"; |
| Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "clientslider", script); |
| slider.OnClientSlide = "clientSlide"; |
| } |
| /* TELERIK RAD GRID */ |
| .RadGrid_Office2007 |
| { |
| border:solid 1px #bfbfbf; |
| } |
| .Custom .GridRow_Office2007 td, |
| .Custom .GridAltRow_Office2007 td, |
| .Custom .GridEditRow_Office2007 td, |
| .Custom .GridFooter_Office2007 td, |
| .Custom .GridGroupFooter_Office2007 td |
| { |
| border:1px #e5e5e5; |
| border-style:none none solid solid; |
| padding-top:4px; |
| padding-bottom:4px; |
| } |
| .Custom .GridRow_Office2007 |
| { |
| background:none #ffffff; |
| line-height:20px; |
| } |
| .Custom .GridAltRow_Office2007 |
| { |
| background:none #f2f2f2; |
| line-height:20px; |
| } |
| .Custom .GridEditRow_Office2007 |
| { |
| background:none #ffffe1; |
| } |
| .Custom .SelectedRow_Office2007 |
| { |
| background:none #ffffe1; |
| } |
| .Custom .SelectedRow_Office2007 td, |
| .Custom .SelectedRow_Office2007>td:first-child |
| { |
| border-color:#f2f2f2; |
| } |
| .Custom .GridRowOver_Office2007 |
| { |
| background:none #666666; |
| } |
| .Custom .GridPager_Office2007 |
| { |
| background: #edf5e5; |
| color:#333333; |
| } |
| .Custom .GridPager_Office2007 td |
| { |
| border:1px solid #bfbfbf; |
| border-left:0px; |
| border-right:0px; |
| padding:1px 4px 2px; |
| } |
| .Custom .PagerLeft_Office2007 |
| { |
| padding:5px; |
| float:right; |
| } |
| .Custom .PagerRight_Office2007 |
| { |
| padding:5px; |
| float:left; |
| } |
| .Custom .GridHeader_Office2007 |
| { |
| color: #666666; |
| font-weight: bold; |
| border-left:1px solid #e5e5e5; |
| border-bottom: solid 1px #e5e5e5; |
| background:none #f2f2f2; |
| padding:5px; |
| } |
| .Custom .GridHeader_Office2007 a, a:link, a:visited |
| { |
| text-decoration:none; |
| font-weight:bold; |
| color:#666666; |
| } |
| .Custom .GridHeader_Office2007 a:hover, a:active |
| { |
| text-decoration:underline; |
| font-weight:bold; |
| color:#666666; |
| } |
| .Custom .InnerHeaderStyle_Office2007 a, a:link, a:visited |
| { |
| text-decoration:none; |
| font-weight:bold; |
| color:#666666; |
| } |
| .Custom .InnerHeaderStyle_Office2007 a:hover, a:active |
| { |
| text-decoration:underline; |
| font-weight:bold; |
| color:#666666; |
| } |
| .Custom .InnerHeaderStyle_Office2007 |
| { |
| color: #666666; |
| font-weight: bold; |
| border-left:1px solid #e5e5e5; |
| border-bottom: solid 1px #e5e5e5; |
| background:none #f2f2f2; |
| padding:5px; |
| } |
| .Custom input[type="text"] |
| { |
| FONT: 11px Arial, Helvetica, sans-serif; |
| COLOR: #333333; |
| MARGIN: 0px 0px 0px 0px; |
| TEXT-ALIGN: left; |
| BORDER: solid 1px #7f9db9; |
| } |
| <telerik:RadGrid ID="RadGridCE" runat="server" |
| Skin="Office2007" |
| CssClass="Custom" |
| > |

| function submitFilter() { |
| debugger; |
| var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); |
| var combo = $find('<%# ((GridItem)Container).FindControl("radComboBox1").ClientID %>'); |
| var ToPicker = $find('<%# ((GridItem)Container).FindControl("ToOrderDatePicker").ClientID %>'); |
| var FromPicker = $find('<%# ((GridItem)Container).FindControl("FromOrderDatePicker").ClientID %>'); |
| var fromDate = FormatSelectedDate(FromPicker); |
| var toDate = FormatSelectedDate(ToPicker); |
| tableView.filter('<%# _fieldName %>', fromDate + " " + toDate, "Between"); |
| tableView.filter("PolicyType", combo.get_selectedItem().get_text(), "EqualTo"); |