I have a page with a RadGrid. Several functions for the grid are in a RadMenu. Several of the functions trigger a JavaScript function to open dialogs, windows, and whatnot, while another menu item does a postback to export the contents of the grid to a .csv file. Everything works fine, with the exception of the export. The menu works properly up to the point where the postback completes and the .csv begins downloading. At that point, the menu re-opens with the Export item highlighted. Is there any way to keep the menu from re-opening after the export is complete?
Here's my menu:
<telerik:RadMenu ID="RadMenu1" runat="server" ExpandDelay="0" CollapseDelay="0" ExpandAnimation-Type="None" CollapseAnimation-Type="None" ShowToggleHandle="true" OnItemClick="RadMenu1_ItemClick" OnClientItemClicking="OnClientItemClicking" ClickToOpen="true" Skin="Windows7"> <Items> <telerik:RadMenuItem Text="Menu" PostBack="false"> <Items> <telerik:RadMenuItem Text="Save..." /> <telerik:RadMenuItem Text="Save As..." Enabled="false" Visible="false" /> <telerik:RadMenuItem Text="Delete" Enabled="false"/> <telerik:RadMenuItem Text="|" runat="server" IsSeparator="True" /> <telerik:RadMenuItem Text="Schedule..." /> <telerik:RadMenuItem Text="Export" /> <telerik:RadMenuItem Text="Print" /> <telerik:RadMenuItem Text="|" runat="server" IsSeparator="True" /> <telerik:RadMenuItem Text="Reset Grid" /> </Items> </telerik:RadMenuItem> </Items></telerik:RadMenu>
Here's the JavaScript that sits behind the menu:
function OnClientItemClicking(sender , args) { var itemText = args.get_item().get_text(); switch(itemText) { case "Save...": args.set_cancel(true); // Cancel postback window.radopen("SaveQueryForm.aspx?KEY=<%= _queryKey %>&user=<%= _username %>&saveKey=<%= _saveKey %>", "RadWindow1"); break; case "Save As...": args.set_cancel(true); // Cancel postback window.radopen("SaveQueryForm.aspx?KEY=<%= _queryKey %>&user=<%= _username %>", "RadWindow1"); break; case "Delete": args.set_cancel(true); // Cancel postback window.radopen("DeleteQueryForm.aspx?savekey=<%= _saveKey %>&&user=<%= _username %>", "RadWindow2"); break; case "Schedule...": args.set_cancel(true); // Cancel postback window.radopen("ScheduleForm.aspx?KEY=<%= _saveKey %>&user=<%= _username %>", "RadWindow3"); break; case "Print": args.set_cancel(true); // Cancel postback openForm(); break; } // end switch if (itemText != "Menu") { closeMenu(); } // end if} // end OnClientItemClickingfunction closeMenu() { var menu = $find("<%=RadMenu1.ClientID %>"); var item = menu.findItemByText("Menu"); item.close(); setTimeout(function() { menu.close(); }, 0);} // end closeMenu
The codebehind that handles the export:
protected void RadMenu1_ItemClick(object sender, RadMenuEventArgs e) { switch (e.Item.Text) { case "Export": exportGridToCSV(); break; } // end switch} // end RadMenu1_ItemClickprotected void exportGridToCSV() { RadGrid1.ExportSettings.ExportOnlyData = false; RadGrid1.ExportSettings.IgnorePaging = true; RadGrid1.ExportSettings.OpenInNewWindow = true; RadGrid1.ExportSettings.FileName = ("Student Data Export - " + DateTime.Now.ToShortDateString()).Replace(' ', '_'); RadGrid1.MasterTableView.ExportToCSV();} // end exportGridToCSV
Any ideas on what I can do to keep the menu from re-opening after the export?
Hi all,
My scenario is as follows. Instead of deleting a record, I would like to Update two fields. The first is "UpdatedBy", which holds a value representing the deleting user. The second is "Deleted", the flag I use to ascertain whether a record has been removed from the system. I would like to do this with a custom DeleteCommand in my SqlDataSource. I have it successfully working in 1 RadGrid, but in another I am getting errors that I need to declare my @Scalar variables. All parameters I use I have declared, but for some reason it just wont recognize them.
This is my working RadGrid:
01.<asp:SqlDataSource ID="StaffSitesDataSource" runat="server" ConnectionString='<%$ ConnectionStrings:MainConnection %>' DeleteCommand=" UPDATE [SitesStaff] SET [UpdatedBy] = @UpdatedBy WHERE [SitesStaffId] = @SitesStaffId; DELETE FROM [SitesStaff] WHERE [SitesStaffId] = @SitesStaffId" InsertCommand="INSERT INTO [SitesStaff] ([SiteId], [StaffId], [UpdatedBy]) VALUES (@SiteId, @StaffId, @UpdatedBy)" SelectCommand="SELECT t0.SitesStaffId, t1.SiteName FROM [SitesStaff] t0 INNER JOIN Sites t1 ON t0.SiteId = t1.SiteId WHERE ([StaffId] = @StaffId)">02. <SelectParameters>03. <asp:ControlParameter ControlID="hdnFldSelectedStaffId" PropertyName="Value" Name="StaffId" Type="Int32"></asp:ControlParameter>04. </SelectParameters>05. <DeleteParameters>06. <asp:Parameter Name="SitesStaffId" Type="Int32"></asp:Parameter>07. <asp:Parameter Name="UpdatedBy" Type="String"></asp:Parameter>08. </DeleteParameters>09. <InsertParameters>10. <asp:Parameter Name="SiteId" Type="Int32"></asp:Parameter>11. <asp:ControlParameter ControlID="hdnFldSelectedStaffId" PropertyName="Value" Name="StaffId" Type="Int32"></asp:ControlParameter>12. <asp:Parameter Name="UpdatedBy" Type="String"></asp:Parameter>13. </InsertParameters>14. </asp:SqlDataSource>15. 16. <telerik:RadGrid ID="rgStaffSites" runat="server" AllowSorting="True" Skin="Windows7" Font-Size="9pt" AutoGenerateDeleteColumn="true" DataSourceID="StaffSitesDataSource" AllowMultiRowSelection="true" OnInsertCommand="rgStaffSites_InsertCommand">17. <MasterTableView AutoGenerateColumns="False" DataSourceID="StaffSitesDataSource" DataKeyNames="SitesStaffId" AllowAutomaticDeletes="true" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" EditMode="PopUp" CommandItemDisplay="Top">18. <CommandItemTemplate>19. <telerik:RadToolBar RenderMode="Lightweight" ID="rtbRgStaffSites" runat="server" Skin="Windows7" AutoPostBack="true">20. <Items>21. <telerik:RadToolBarButton Text="Add new" CommandName="InitInsert" ImageUrl="~/Images/AddRecord.gif" Visible='<%# Not rgStaffSites.MasterTableView.IsItemInserted %>'></telerik:RadToolBarButton>22. <telerik:RadToolBarButton Text="Delete selected Sites" CommandName="DeleteSelected" ImageUrl="~/Images/Delete.gif"></telerik:RadToolBarButton>23. <telerik:RadToolBarButton Text="Refresh Sites" CommandName="RebindGrid" ImageUrl="~/Images/Refresh.gif"></telerik:RadToolBarButton>24. <telerik:RadToolBarButton Value="UserName" OuterCssClass="rightButton">25. <ItemTemplate>26. <asp:Label ID="lblSelectedUserName2" runat="server"></asp:Label>27. </ItemTemplate>28. </telerik:RadToolBarButton>29. </Items>30. </telerik:RadToolBar>31. </CommandItemTemplate>32. <EditFormSettings InsertCaption="Add Site">33. <PopUpSettings CloseButtonToolTip="Cancel Add" Modal="false" OverflowPosition="Center" />34. <EditColumn ButtonType="ImageButton"></EditColumn>35. </EditFormSettings>36. <Columns>37. <telerik:GridClientSelectColumn UniqueName="SelectColumn" ItemStyle-Width="25px" HeaderStyle-Width="25px"></telerik:GridClientSelectColumn>38. <telerik:GridBoundColumn DataField="SitesStaffId" ReadOnly="True" Display="false" Visible="true" HeaderText="SitesStaffId" SortExpression="SitesStaffId" UniqueName="SitesStaffId" DataType="System.Int32" FilterControlAltText="Filter SitesStaffId column"></telerik:GridBoundColumn>39. <telerik:GridTemplateColumn HeaderText="Site" UniqueName="SiteName" DataField="SiteName" FilterControlAltText="Filter SiteName column" ItemStyle-HorizontalAlign="Left">40. <ItemTemplate>41. <%# Eval("SiteName") %>42. </ItemTemplate>43. <EditItemTemplate>44. <telerik:RadComboBox ID="rgStaffSites_rcbSites" runat="server" DataSourceID="SitesDataSource" DataTextField="SiteName" DataValueField="SiteId" Skin="Windows7" CheckBoxes="true"></telerik:RadComboBox>45. </EditItemTemplate>46. </telerik:GridTemplateColumn>47. </Columns>48. </MasterTableView>49. <ClientSettings>50. <ClientEvents OnPopUpShowing="PopUpShowing" />51. <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />52. </ClientSettings>53. </telerik:RadGrid>
This is the RadGrid I cant get to work:
01.<asp:SqlDataSource ID="TasksCollaboratorsDataSource" runat="server" ConnectionString='<%$ ConnectionStrings:MainConnection %>' DeleteCommandType="Text" DeleteCommand="UPDATE [TasksSharing] SET [UpdatedBy] = @UpdatedBy, [Deleted] = @Deleted WHERE [ShareId] = @ShareId" InsertCommand="INSERT INTO [TasksSharing] ([TaskId], [TimeShared], [SharedBy], [SharedWith], [Implementing], [Accountable], [AccessLevel], [Deleted], [UpdatedBy]) VALUES (@TaskId, @TimeShared, @SharedBy, @SharedWith, @Implementing, @Accountable, @AccessLevel, @Deleted, @UpdatedBy)" SelectCommand="SELECT * FROM [TasksSharing] WHERE ([TaskId] = @TaskId AND [Deleted] = @Deleted)" UpdateCommand="UPDATE [TasksSharing] SET [UpdatedBy] = @UpdatedBy, [Implementing] = @Implementing, [Accountable] = @Accountable, [AccessLevel] = @AccessLevel WHERE [ShareId] = @ShareId">02. <DeleteParameters> 03. <asp:Parameter Name="UpdatedBy" Type="String"></asp:Parameter>04. <asp:Parameter Name="Deleted" Type="Boolean" DefaultValue="True"></asp:Parameter>05. <asp:Parameter Name="ShareId" Type="Int32"></asp:Parameter>06. </DeleteParameters>07. <InsertParameters>08. <asp:Parameter Name="TaskId" Type="Int32"></asp:Parameter>09. <asp:Parameter Name="TimeShared" Type="DateTime"></asp:Parameter>10. <asp:Parameter Name="SharedBy" Type="String"></asp:Parameter>11. <asp:Parameter Name="SharedWith" Type="String"></asp:Parameter>12. <asp:Parameter Name="Implementing" Type="Boolean"></asp:Parameter>13. <asp:Parameter Name="Accountable" Type="Boolean"></asp:Parameter>14. <asp:Parameter Name="AccessLevel" Type="String"></asp:Parameter>15. <asp:Parameter Name="UpdatedBy" Type="String"></asp:Parameter>16. <asp:Parameter Name="Deleted" Type="Boolean" DefaultValue="True"></asp:Parameter>17. </InsertParameters>18. <SelectParameters>19. <asp:ControlParameter Name="TaskID" ControlID="hdnFldSelectedTaskID" Type="Int32" DefaultValue="0" ConvertEmptyStringToNull="true"></asp:ControlParameter>20. <asp:Parameter Name="Deleted" Type="Boolean" DefaultValue="False"></asp:Parameter>21. </SelectParameters>22. <UpdateParameters>23. <asp:Parameter Name="Implementing" Type="Boolean"></asp:Parameter>24. <asp:Parameter Name="Accountable" Type="Boolean"></asp:Parameter>25. <asp:Parameter Name="AccessLevel" Type="String"></asp:Parameter>26. <asp:Parameter Name="ShareId" Type="Int32"></asp:Parameter>27. <asp:Parameter Name="UpdatedBy" Type="String"></asp:Parameter>28. </UpdateParameters>29. </asp:SqlDataSource>30. 31. 32. <telerik:RadGrid ID="rgTasksCollaborators" runat="server" DataSourceID="TasksCollaboratorsDataSource" AllowSorting="True" AllowFilteringByColumn="True" Skin="Windows7"33. AllowAutomaticDeletes="true" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowMultiRowSelection="true" AutoGenerateDeleteColumn="true" OnItemCommand="rgCollaborators_ItemCommand">34. <ClientSettings>35. <Selecting AllowRowSelect="True" EnableDragToSelectRows="true"></Selecting>36. </ClientSettings>37. <MasterTableView DataSourceID="TasksCollaboratorsDataSource" AutoGenerateColumns="False" DataKeyNames="ShareId" CommandItemDisplay="Top">38. <CommandItemTemplate>39. <telerik:RadToolBar ID="rtbTasksCollaborators" RenderMode="Lightweight" runat="server" Skin="Windows7" AutoPostBack="true">40. <Items>41. <telerik:RadToolBarButton Text="Add Collaborator" CommandName="InitInsert" ImageUrl="~/Images/AddRecord.gif"></telerik:RadToolBarButton>42. <telerik:RadToolBarButton Text="Remove Selected Collaborators" CommandName="DeleteSelected" ImageUrl="~/Images/Delete.gif"></telerik:RadToolBarButton>43. <telerik:RadToolBarButton Text="Refresh Colaborators" CommandName="RebindGrid" ImageUrl="~/Images/Refresh.gif" OuterCssClass="rightButton"></telerik:RadToolBarButton>44. </Items>45. </telerik:RadToolBar>46. </CommandItemTemplate>47. <ItemStyle CssClass="defaultRadGridItem" />48. <AlternatingItemStyle CssClass="defaultRadGridItem" />49. <EditFormSettings>50. <EditColumn ButtonType="ImageButton"></EditColumn>51. <PopUpSettings Width="600px" CloseButtonToolTip="Cancel" />52. <FormTemplate>53. </FormTemplate>54. </EditFormSettings>55. <Columns>56. <telerik:GridClientSelectColumn UniqueName="selectColumn"></telerik:GridClientSelectColumn>57. <telerik:GridEditCommandColumn UniqueName="editColumn"></telerik:GridEditCommandColumn>58. <telerik:GridBoundColumn DataField="ShareId" ReadOnly="True" Display="false" HeaderText="ShareId" SortExpression="ShareId" UniqueName="ShareId" DataType="System.Int32" FilterControlAltText="Filter ShareId column"></telerik:GridBoundColumn>59. <telerik:GridBoundColumn DataField="TaskId" Display="false" HeaderText="TaskId" SortExpression="TaskId" UniqueName="TaskId" DataType="System.Int32" FilterControlAltText="Filter TaskId column"></telerik:GridBoundColumn>60. <telerik:GridDateTimeColumn DataField="TimeShared" HeaderText="Time Shared" SortExpression="TimeShared" UniqueName="TimeShared" DataType="System.DateTime" FilterControlAltText="Filter TimeShared column"></telerik:GridDateTimeColumn>61. <telerik:GridBoundColumn DataField="SharedBy" HeaderText="Shared By" SortExpression="SharedBy" UniqueName="SharedBy" FilterControlAltText="Filter SharedBy column"></telerik:GridBoundColumn>62. <telerik:GridBoundColumn DataField="SharedWith" HeaderText="Shared With" SortExpression="SharedWith" UniqueName="SharedWith" FilterControlAltText="Filter SharedWith column"></telerik:GridBoundColumn>63. <telerik:GridCheckBoxColumn DataField="Implementing" HeaderText="Implementing" SortExpression="Implementing" UniqueName="Implementing" DataType="System.Boolean" FilterControlAltText="Filter Implementing column"></telerik:GridCheckBoxColumn>64. <telerik:GridCheckBoxColumn DataField="Accountable" HeaderText="Accountable" SortExpression="Accountable" UniqueName="Accountable" DataType="System.Boolean" FilterControlAltText="Filter Accountable column"></telerik:GridCheckBoxColumn>65. <telerik:GridDropDownColumn DataField="AccessLevel" HeaderText="Access Level" SortExpression="AccessLevel" UniqueName="AccessLevel" FilterControlAltText="Filter AccessLevel column" DataSourceID="AccessLevelsDatasource" ListTextField="ItemValue" ListValueField="ItemId"></telerik:GridDropDownColumn>66. <telerik:GridCheckBoxColumn DataField="Deleted" Display="false" HeaderText="Deleted" SortExpression="Deleted" UniqueName="Deleted" DataType="System.Boolean" FilterControlAltText="Filter Deleted column"></telerik:GridCheckBoxColumn>67. <telerik:GridBoundColumn DataField="UpdatedBy" Display="false" HeaderText="UpdatedBy" SortExpression="UpdatedBy" UniqueName="UpdatedBy" FilterControlAltText="Filter UpdatedBy column"></telerik:GridBoundColumn>68. </Columns>69. </MasterTableView>70. </telerik:RadGrid>
I feel like it is something obvious that I am not seeing. Any help would be greatly appreciated.
Thanks,
Mike

So I've been trying to use these tools for a few hours and they seem really cool, but I feel like I'm doing something wrong.
Basically I put a radpagelayout control onto the page I'm working on, then I put 3 rows in it and two columns in each row. In the code I can see that and using the <Content> tags I can put stuff in the columns or I can drag a control in between <Content> and </Content> and have it show up that way. On the design tab though the pagelayout appears as just a square and I can't drag say a button into it and have it be in the pagelayout's grid. The only way to make the layout not be a little square in the corner is the put something into the code manually, and even then I cant drag other controls onto it. How do I do it, what am I doing wrong?
TL;DR RadPageLayout appears as a small square on design tab and I can't put controls onto it even when I make rows/columns in the properties. Not sure what I'm doing wrong.

I have a scheduler setup where the datasource select command also has a control parameter being passed in from a combo box. The generated execute_sql statement does not seem to work and sql server complains about parameter not being passed in. I have tried executing the generated statement manually in sql server and the result is the same. The code is bellow:
SelectCommand="EXEC Scheduler.GetAppointments"
<SelectParameters>
<asp:ControlParameter ControlID="cmbProviderSort" DbType="Int32" ConvertEmptyStringToNull="true" DefaultValue="-1"
PropertyName="SelectedValue" Name="a" />
</SelectParameters>
The generated statement from this is : exec sp_executesql N'EXEC Scheduler.GetAppointments',N'@a int',@a=26
If i try and execute that statement on sql server it complains the @a parameter is not being passed.
Thanks

Hi I am new to telerik i do my project by using telerik controls. I want to build entry form in batch edit mode but i cant to bind data from the database for cascading combo boxes in batch edit mode. Please help me
I have three types of columns insurance plan,insurance type, insurance policy but i cant the data from <itemtemplate event> </itemtemplate>
HI,
I have been using the Rotator with transparent PNGs. I had to set the RenderMode for the Rotator to 'Classic' for the transparency to work, however with Q1 2017 this does not work and the images all have a white background now.
Please help
Jon.
