or
| <Tree> | |
| <Node Text="Front Page" Value="" ContextMenuID="rtvcmFrontPage"/> | |
| <Node Text="Section One" Value="1" ContextMenuID="rtvcmSection" /> | |
| <Node Text="Section Two" Value="2" ContextMenuID="rtvcmSection" CanDelete="False" CanEdit="False" /> | |
| <Node Text="Section Three" Value="3" ContextMenuID="rtvcmSection" /> | |
| <Node Text="Section Four" Value="4" ContextMenuID="rtvcmSection" CanDelete="False" /> | |
| <Node Text="Section Five" Value="5" ContextMenuID="rtvcmSection" /> | |
| </Tree> |
| <telerik:RadTreeView ID="rtvSections" runat="server" | |
| OnClientNodeClicked="ClientNodeClicked" | |
| OnClientContextMenuItemClicking="ClientContextMenuItemClicking"> | |
| <ExpandAnimation Duration="200" /> | |
| <CollapseAnimation Duration="200" Type="OutQuint" /> | |
| <ContextMenus> | |
| <telerik:RadTreeViewContextMenu ID="rtvcmSection" runat="server"> | |
| <Items> | |
| <telerik:RadMenuItem Text="Insert Section"> | |
| <Items> | |
| <telerik:RadMenuItem Text="Before" Value="InsertSectionBefore" /> | |
| <telerik:RadMenuItem Text="After" Value="InsertSectionAfter" /> | |
| </Items> | |
| </telerik:RadMenuItem> | |
| <telerik:RadMenuItem Text="Edit Section" Value="EditSection" /> | |
| <telerik:RadMenuItem Text="Delete Section" Value="DeleteSection" /> | |
| <telerik:RadMenuItem IsSeparator="true" /> | |
| <telerik:RadMenuItem Text="New Item" Value="NewItem" /> | |
| </Items> | |
| </telerik:RadTreeViewContextMenu> | |
| </ContextMenus> | |
| </telerik:RadTreeView> |
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| } |
| GridEditableItem insertItem = e.Item.OwnerTableView.GetInsertItem(); |
| ListBox ListBoxA = (ListBox)insertItem.FindControl("ListBox1"); |
I use RadUpload in the EditForm template in the RadGrid.
My question is: How to disable AJAX when the user clicks "Insert" or "Update" button?
The Javascript codes I used doesn't work:
| var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$","ig"); |
| if (sender.EventTarget.match(theRegexp)) |
| { |
| sender.EnableAjax = false; |
| } |
Please look at the codes for RadUpload and buttons in EditForm at below
| <EditFormSettings EditFormType="Template"> |
| <FormTemplate> |
| <table> |
| <tr> |
| <td>File:</td> |
| <td> |
| <telerik:RadUpload ID="RadUpload1" Skin="Vista" runat="server" InitialFileInputsCount="1" MaxFileInputsCount="1" ControlObjectsVisibility="None" MaxFileSize="1000000" AllowedFileExtensions=".pdf" TargetPhysicalFolder="<%$ appSettings:UploadPath %>" /> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button> |
| <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| </FormTemplate> |
| </EditFormSettings> |
Thanks,Jason
| <telerik:RadMenuItem NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" CssClass="menuSpeedOrdering"> |
| <Items> |
| <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" GroupSettings-ExpandDirection="Up" GroupSettings-OffsetX="100" GroupSettings-Width="200"> |
| <Items> |
| <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| </Items> |
| </telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> |
| </Items> |
| </telerik:RadMenuItem> |
| /* RadMenu Telerik Skin */ |
| /* Text color size and style of whole menu*/ |
| /*Entire menu*/ |
| div.RadMenu_Shade ul.rmHorizontal |
| { |
| border: 0px solid #262626; |
| float: left; |
| padding: 0; |
| width: 795px; |
| height: 40px; |
| margin-left: auto; |
| margin-right: auto; |
| /*background: transparent url('../images/menu/light.gif');*/ |
| } |
| /* Normal Item */ |
| .rmHorizontal .rmItem |
| { |
| width: 112px; |
| height: 37px; |
| /*background: transparent url('../images/menu/light.gif');*/ |
| } |
| .rmHorizontal .rmItem .menuSpeedOrdering |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu1.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .menuSpeedOrdering:hover, .rmHorizontal .menuSpeedOrdering:active |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu1a.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .rmItem .menuCatalogBrowse |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu2.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .menuCatalogBrowse:hover, .rmHorizontal .menuCatalogBrowse:active |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu2a.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .rmItem .menuProductFinder |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu3.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .menuProductFinder:hover, .rmHorizontal .menuProductFinder:active |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu3a.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .rmItem .menuTrackOrders |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu4.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .menuTrackOrders:hover, .rmHorizontal .menuTrackOrders:active |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu4a.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .rmItem .menuAdminUsers |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu5.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .menuAdminUsers:hover, .rmHorizontal .menuAdminUsers:active |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu5a.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .rmItem .menuCompanyInfo |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu6.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .menuCompanyInfo:hover, .rmHorizontal .menuCompanyInfo:active |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu6a.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .rmItem .menuCustService |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu7.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .menuCustService:hover, .rmHorizontal .rmItem .menuCustService .menuCustService:active |
| { |
| width: 112px; |
| height: 37px; |
| background: transparent url('../images/menu/btn_menu7a.gif') no-repeat 0 0; |
| } |
| .rmHorizontal .rmLink:hover, |
| .rmHorizontal .rmFocused, |
| .rmHorizontal .rmExpanded |
| { |
| width: 112px; |
| height: 37px; |
| } |
| .rmHorizontal .rmText |
| { |
| padding: 8px 24px 8px 14px; |
| } |
| ul.rmVertical |
| { |
| border: 1px solid #808080; |
| float: left; |
| background: url('../images/menu/dropdowndot.gif') repeat; |
| } |
| .rmVertical .rmItem |
| { |
| height: 20px; |
| overflow:hidden; |
| padding-bottom: 4px; |
| } |
| .rmVertical .rmLink |
| { |
| height: 20px; |
| overflow:hidden; |
| padding-bottom: 4px; |
| } |
| .rmVertical .rmText |
| { |
| height: 20px; |
| overflow:hidden; |
| padding-bottom: 4px; |
| } |
| .rmVertical .rmExpandRight |
| { |
| } |
| .rmVertical .rmLink:hover, |
| .rmVertical .rmFocused, |
| .rmVertical .rmExpanded |
| { |
| color: white; |
| background: url('../images/menu/dropdowndotdark.gif') repeat; |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmVertical .rmLink:hover .rmText, |
| .rmVertical .rmFocused .rmText, |
| .rmVertical .rmExpanded .rmText |
| { |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmVertical .rmLink:hover .rmExpandRight, |
| .rmVertical .rmFocused .rmExpandRight, |
| .rmVertical .rmExpanded .rmExpandRight |
| { |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmVertical .rmGroup |
| { |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmVertical .rmGroup .rmLink |
| { |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmVertical .rmGroup .rmText |
| { |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmVertical .rmGroup .rmLink:hover, |
| .rmVertical .rmGroup .rmFocused, |
| .rmVertical .rmGroup .rmExpanded |
| { |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmVertical .rmGroup .rmLink:hover .rmText, |
| .rmVertical .rmGroup .rmFocused .rmText, |
| .rmVertical .rmGroup .rmExpanded .rmText |
| { |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmVertical .rmGroup .rmLink:hover .rmExpandRight, |
| .rmVertical .rmGroup .rmFocused .rmExpandRight, |
| .rmVertical .rmGroup .rmExpanded .rmExpandRight |
| { |
| height: 20px; |
| overflow:hidden; |
| } |
| .rmSeparator |
| { |
| } |
| .rmSeparator .rmText |
| { |
| } |
| .rmTopArrowDisabled, |
| .rmBottomArrowDisabled, |
| .rmLeftArrowDisabled, |
| .rmRightArrowDisabled |
| { |
| display: none; |
| } |
| .rmTopArrow, |
| .rmBottomArrow, |
| .rmLeftArrow, |
| .rmRightArrow |
| { |
| font-size: 0; |
| color: #fff; |
| line-height: 0; |
| } |
| .rmTopArrow, |
| .rmBottomArrow |
| { |
| height: 10px; |
| width: 100%; |
| } |
| .rmBottomArrow |
| { |
| background-position: center -18px; |
| } |
| .rmLeftArrow, |
| .rmRightArrow |
| { |
| width: 10px; |
| height: 100%; |
| } |
| .rmRightArrow |
| { |
| background-position: -18px center; |
| } |
| <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" Skin="Vista" runat="server" |
| AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="50"> |
| <MasterTableView TableLayout="Auto" AutoGenerateColumns="false" Width="500px"> |
| <Columns> |
| <telerik:GridHyperLinkColumn DataNavigateUrlFields="CampaignName,BranchName", DataNavigateUrlFormatString="BranchReport.aspx?CampaignName={0}&BranchName={1}" DataTextField="BranchName" HeaderText="Shop" SortExpression="BranchName"></telerik:GridHyperLinkColumn> |
| <telerik:GridBoundColumn DataField="GrossToday" HeaderText="Gross Today" SortExpression="GrossToday"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="GrossTW" HeaderText="Gross This Week" SortExpression="GrossTW"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="GrossTP" HeaderText="Gross This Period" SortExpression="GrossTP"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="GrossTY" HeaderText="Gross This Year" SortExpression="GrossTY"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="PaxToday" HeaderText="Pax Today" SortExpression="PaxToday"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="PaxTW" HeaderText="Pax This Week" SortExpression="PaxTW"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="PaxTP" HeaderText="Pax This Period" SortExpression="PaxTP"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="PaxTY" HeaderText="Pax This Year" SortExpression="PaxTY"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="TargetTW" HeaderText="Target This Week" SortExpression="TargetTW"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="TargetTP" HeaderText="Target This Period" SortExpression="TargetTP"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="TargetTY" HeaderText="Target This Year" SortExpression="TargetTY"></telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true"> |
| <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" |
| AllowColumnResize="True"></Resizing> |
| <Selecting AllowRowSelect="True"></Selecting> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="1"> |
| </Scrolling> |
| </ClientSettings> |
| <HeaderStyle Width="120px" /> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| </telerik:RadGrid> |
| C#: { |
| var cb = RadComboBox1; |
| if (some_condition == true) |
| cb.OnClientSelectedIndexChanged = "OnClientSelectedIndexChanged"; |
| } |
| <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="200px" |
| MarkFirstMatch="true" HighlightTemplatedItems="true" |
| DataTextField="Text" DataValueField="ID" ItemRequestTimeout="500" |
| Skin="Vista"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </telerik:RadComboBox> |
| function OnClientSelectedIndexChanged(item) |
| { |
| var combo = item.ComboBox; |
| alert(combo.GetText() + ' ' + combo.GetValue() + ' - ' + combo.ClientID); |
| } |
| function ConditionallyEnableClearButton(sender, eventArgs) { |
| var masterTableView = sender.get_masterTableView(); |
| var selectedItems = masterTableView.get_selectedItems(); |
| var visibility = selectedItems.length > 0 ? "inline" : "none"; |
| var button = document.getElementById('<%= AlertGrid.MasterTableView.GetItems(GridItemType.CommandItem)[0].FindControl("ClearButton").ClientID %>'); |
| if (button) { |
| button.style.display = visibility; |
| } |
| } |
| LinkButton clearButton = |
| grid.MasterTableView.GetItems(GridItemType.CommandItem)[0].FindControl(CLEAR_BUTTON) as LinkButton; |
| var oldValue = clearAlertsButton.Style["display"]; |
| clearAlertsButton.Style["display"] = grid.SelectedItems.Count > 0 ? "inline" : "none"; |