popupScript =
"<script>var wnd = window.radopen(\"[path]\", \"[name]\");</script>";
Page.RegisterStartupScript(
"PopupScript", popupScript);
function
OpenWindow(name) {
var wnd = window.radopen([path], [name]);
wnd.Maximize();
return false;
}
[c#]
popupScript =
"<script>OpenWindow('[name]');</script>";
Page.RegisterStartupScript("PopupScript", popupScript);
or:
popupScript = 'javascript:OpenWindow('[name]');:;
Page.RegisterStartupScript("PopupScript", popupScript);
I know that Page.RegisterStartupScript is considered obsolete, but it still works to open normal windows. Is there something specific I would have to do to make a RadWindow able to be opened in server code?
| Protected Sub rgTimeslips_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles rgTimeslips.ItemCommand |
| If (e.CommandName = RadGrid.EditCommandName) Then |
| e.Item.OwnerTableView.EditFormSettings.CaptionFormatString = "Edit Time Slip" |
| Dim frmitem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem) |
| Dim ddlreason As RadComboBox = DirectCast(frmitem.FindControl("ddlReason1"), RadComboBox) |
| ddlreason.Skin = Application("TelerikTheme") |
| End If |
| End Sub |
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
| Protected Sub RadAjaxManagerProxy1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) |
| Dim grid As Telerik.Web.UI.RadGrid = DirectCast(FindControl("RadMultiPage1").FindControl("PageSearch").FindControl("grdSearchRFS"), Telerik.Web.UI.RadGrid) |
| If e.Argument = "Rebind" Then |
| grid.MasterTableView.SortExpressions.Clear() |
| grid.MasterTableView.GroupByExpressions.Clear() |
| grid.Rebind() |
| ElseIf e.Argument = "RebindAndNavigate" Then |
| grid.MasterTableView.SortExpressions.Clear() |
| grid.MasterTableView.GroupByExpressions.Clear() |
| grid.MasterTableView.CurrentPageIndex = grid.MasterTableView.PageCount - 1 |
| grid.Rebind() |
| End If |
| End Sub |
<
telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
| function refreshGrid(arg) |
| { |
| if(!arg) |
| { |
| $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); |
| } |
| else |
| { |
| $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate"); |
| } |
| } |
| <telerik:RadWindowManager ID="RadWindowManager1" runat="server" ShowContentDuringLoad="False" |
| VisibleStatusbar="False" Modal="True" Behaviors="Close, Resize, Move" Height="550px" |
| Width="1000px"> |
| <Windows> |
| <telerik:RadWindow ID="CallDetails" runat="server" Left="" NavigateUrl="RFSDetail.aspx" |
| Height="550px" Width="1000px" Style="display: none;" Title="RFS Detail" Top="" |
| OnClientClose="refreshGrid"> |
| </telerik:RadWindow> |
| </Windows> |
| </telerik:RadWindowManager> |
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
| </telerik:RadScriptManager> |
| </div> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" |
| ConnectionString="<%$ ConnectionStrings:NwindConnectionString %>" |
| DeleteCommand="DELETE FROM [Customers] WHERE (([CustomerID] = ?) OR ([CustomerID] IS NULL AND ? IS NULL))" |
| InsertCommand="INSERT INTO [Customers] ([CustomerID], [CompanyName]) VALUES (?, ?)" |
| ProviderName="<%$ ConnectionStrings:NwindConnectionString.ProviderName %>" |
| SelectCommand="SELECT CustomerID, CompanyName, postalcODE FROM Customers where LEFT(CustomerID,2) <= "CB" ORDER BY CustomerID" |
| UpdateCommand="UPDATE [Customers] SET [CompanyName] = ? WHERE (([CustomerID] = ?) OR ([CustomerID] IS NULL AND ? IS NULL))"> |
| <DeleteParameters> |
| <asp:Parameter Name="CustomerID" Type="String" /> |
| </DeleteParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="CompanyName" Type="String" /> |
| <asp:Parameter Name="CustomerID" Type="String" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="CustomerID" Type="String" /> |
| <asp:Parameter Name="CompanyName" Type="String" /> |
| </InsertParameters> |
| </asp:SqlDataSource> |
| <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" |
| GridLines="None" AllowPaging="True" AllowSorting="True"> |
| <MasterTableView DataSourceID="SqlDataSource1" CommandItemDisplay= "TopAndBottom" |
| AutoGenerateColumns="False" DataKeyNames="CustomerID"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="CustomerID" DefaultInsertValue="" |
| HeaderText="CustomerID" ReadOnly="True" SortExpression="CustomerID" |
| UniqueName="CustomerID"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="CompanyName" DefaultInsertValue="" |
| HeaderText="CompanyName" SortExpression="CompanyName" UniqueName="CompanyName"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <CommandItemTemplate> |
| <div style="padding: 5px 5px;"> |
| Custom command item template for Grid: |
| <asp:linkbutton id="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" /> Edit selected</asp:LinkButton> |
| <asp:linkbutton id="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.gif" /> Update</asp:LinkButton> |
| <asp:linkbutton id="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.gif" /> Cancel editing</asp:LinkButton> |
| <asp:linkbutton id="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" /> Add new</asp:LinkButton> |
| <asp:linkbutton id="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" /> Add this </asp:LinkButton> |
| <asp:linkbutton id="LinkButton1" OnClientClick="javascript:return confirm('Delete selected?')" |
| runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" /> Delete selected Jobs</asp:LinkButton> |
| </div> |
| </CommandItemTemplate> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </form> |
| </body> |
| </html> |
| <td><telerik:RadComboBox ID="RadComboBox1" runat="server" /></td> |
| <td> |
| <telerik:RadListBox ID="RadListBox1" runat="server" Height="200px" Width="200px" |
| AllowTransfer="true" TransferToID="RadListBox2" |
| AutoPostBackOnTransfer="true" |
| SelectionMode="Multiple" EnableDragAndDrop="true" |
| OnTransferring="RadListBox1_Transferring" /> |
| </td> |
| <td> |
| <telerik:RadListBox ID="RadListBox2" runat="server" Height="200px" Width="200px" |
| AutoPostBackOnTransfer="true" |
| SelectionMode="Multiple" EnableDragAndDrop="true" /> |
| </td> |
| protected void RadListBox1_Transferring(object sender, RadListBoxTransferringEventArgs e) |
| { |
| AddToDefaultComboBox(true); |
| RemoveFromDefaultComboBox(true); // Needs to be in different event to return back to left. (maybe RadListBox2_Transferring). But RadListBox2.AllowTransfer="false" ??? find solution. |
| } |
// Adds item(s) to RadComboBox1 when transferring from RadListBox1 to RadListBox2 |
| private void AddToDefaultComboBox(bool all) |
| { |
| foreach (RadListBoxItem li in RadListBox1.Items) |
| { |
| if ((li.Selected) || (all)) |
| { |
| RadComboBox1.Items.Add(new RadComboBoxItem(li.Text, li.Value)); |
| } |
| } |
| } // Removes item(s) to RadComboBox1 when transferring from RadListBox2 to RadListBox1 |
| private void RemoveFromDefaultComboBox(bool all) |
| { |
| foreach (RadListBoxItem li in RadListBox2.Items) |
| { |
| if ((li.Selected) || (all)) |
| { |
| RadComboBox1.Items.Remove(RadComboBox1.Items.FindItemByValue(li.Value)); |
| } |
| } |
| } |
| <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" |
| GridLines="None" AllowFilteringByColumn="True" AllowSorting="True" ShowGroupPanel="True" |
| ShowFooter="True"> |
| <MasterTableView DataSourceID="SqlDataSource1"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="nr_ewid" HeaderText="Nr ewid." AllowFiltering="true" |
| UniqueName="nr_ewid"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="nr_dok" HeaderText="Nr fakt." AllowFiltering="true" |
| UniqueName="nr_dok"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="nazwa" HeaderText="Wystawca" AllowFiltering="true" |
| UniqueName="nazwa"> |
| </telerik:GridBoundColumn> |
| <telerik:GridDateTimeColumn DataField="data_wplyw" HeaderText="Wpłyneła" DataFormatString="{0: dd-MM-yyyy}" |
| AllowFiltering="true" HeaderStyle-Width="90px" ItemStyle-Width="90px" UniqueName="data_wplyw"> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridDateTimeColumn DataField="data_wyst" HeaderText="Wystawiona" DataFormatString="{0: dd-MM-yyyy}" |
| AllowFiltering="true" HeaderStyle-Width="90px" ItemStyle-Width="90px" UniqueName="data_wyst"> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridNumericColumn DataField="wartosc" HeaderText="Kwota brutto" Aggregate="Sum" |
| AllowFiltering="true" UniqueName="wartosc" KeepNotRoundedValue="true"> |
| </telerik:GridNumericColumn> |
| <telerik:GridNumericColumn DataField="wartosc_netto" HeaderText="Kwota netto" Aggregate="Sum" |
| AllowFiltering="true" UniqueName="wartosc_netto" KeepNotRoundedValue="true"> |
| </telerik:GridNumericColumn> |
| <telerik:GridBoundColumn DataField="w_obiegu" HeaderText="W obiegu" AllowFiltering="true" |
| UniqueName="w_obiegu"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="do" HeaderText="Pracownik" AllowFiltering="true" |
| UniqueName="pracownik"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="przetrzymuje" HeaderText="Przetrzymuje" AllowFiltering="true" |
| UniqueName="przetrzymuje"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="status" HeaderText="Status" AllowFiltering="true" |
| UniqueName="status"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True"> |
| <Selecting AllowRowSelect="True" /> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| Protected Sub cmb_excel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmb_excel.Click |
| RadGrid1.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML |
| RadGrid1.ExportSettings.ExportOnlyData = True |
| RadGrid1.MasterTableView.ExportToExcel() |
| End Sub |