or
| <telerik:RadGrid ID="grdTopics" runat="server" AutoGenerateColumns="False" GridLines="None" AllowPaging="false" AllowSorting="false" ShowFooter="false" ShowHeader="true" > |
| <ClientSettings AllowExpandCollapse="true"></ClientSettings> |
| <MasterTableView Name="Topics" EditMode="InPlace" DataKeyNames="ID" HierarchyLoadMode="Client" NoMasterRecordsText="There are no Topics." NoDetailRecordsText="There are no Topics."> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridTemplateColumn HeaderText="Moderators" UniqueName="Moderators"> |
| <ItemTemplate> |
| <asp:Label ID="lblTopics_View_Moderators" runat="server"></asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadListBox ID="lstTopics_Edit_Moderators" runat="server" CheckBoxes="true" DataKeyField="ID" DataTextField="Name" ></telerik:RadListBox> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="" UniqueName="Edit Topic"> |
| <ItemTemplate> |
| <asp:ImageButton ID="btnTopics_View_EditTopic" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/edit.gif" AlternateText="Edit Topic" CommandName="TOPICS_EDIT" CausesValidation="false" /> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:ImageButton ID="btnTopics_Edit_SaveTopic" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/save.gif" AlternateText="Save Topic" CommandName="TOPICS_SAVE" CausesValidation="false" /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="" UniqueName="Delete Topic"> |
| <ItemTemplate> |
| <asp:ImageButton ID="btnTopics_View_DeleteTopic" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/delete.gif" AlternateText="Delete Topic" CommandName="TOPICS_DELETE" CausesValidation="false" OnClientClick="return ConfirmDelete();"/> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:ImageButton ID="btnTopics_Edit_CancelTopic" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/cancel.gif" AlternateText="Cancel" CommandName="TOPICS_CANCEL" CausesValidation="false" /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="" UniqueName="Move Topic Up"> |
| <ItemTemplate> |
| <asp:ImageButton ID="btnTopics_View_MoveUp" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/action_up.gif" AlternateText="Move Topic Up" CommandName="TOPICS_MOVEUP" CausesValidation="false" /> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:Image ID="imgTopics_Edit_MoveUpSpacer" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/spacer.gif" /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="" UniqueName="Move Topic Down"> |
| <ItemTemplate> |
| <asp:ImageButton ID="btnTopics_View_MoveDown" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/action_down.gif" AlternateText="Move Topic Down" CommandName="TOPICS_MOVEDOWN" CausesValidation="false" /> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:Image ID="imgTopics_Edit_MoveDownSpacer" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/spacer.gif" /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| 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> |