<div id="LoadReportPanel"> <div style="float: right"> ... </div> <div style="float: right; padding-top: 2px;"> <div style="position: absolute; top: 38px; left: 4px; z-index: 9999999;"> ... </div> <asp:Label ID="Label1" runat="server" Text="Report Template: "></asp:Label> <telerik:RadComboBox ID="ReportTemplatesDropDown" runat="server" Width="300px" Height="250"> <ItemTemplate> <div id="ReportTemplatesDropDownTreeViewDIV"> <telerik:RadTreeView ID="ReportTemplatesDropDownTreeView" runat="server" Expanded="True"> </telerik:RadTreeView> </div> </ItemTemplate> <Items> <telerik:RadComboBoxItem runat="server" Text="Select a Report Template" /> </Items> </telerik:RadComboBox> </div> </div>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;using System.ComponentModel;using System.Collections;using System.Collections.Specialized;namespace WebApplication1{ // Default Page public partial class _Default : System.Web.UI.Page { protected override void OnInit(EventArgs e) { base.OnInit(e); if (IsPostBack) createStaticControls(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) createStaticControls(); } private void createStaticControls() { int index = 0; GridViewExtension gridView = new GridViewExtension(); gridView.EnableInsert = true; gridView.rowSize = 20; Panel1.Controls.Add(gridView); while (index != 5) { TemplateField tfield = new TemplateField(); tfield.Visible = true; tfield.ItemTemplate = new DynamicControl(index); tfield.HeaderText = index.ToString(); gridView.Columns.Add(tfield); index++; } gridView.DataBind(); Button b = new Button(); Panel1.Controls.Add(b); } } // Control - ITemplate, now always an RadComboBox public class DynamicControl : ITemplate { private int index; public DynamicControl(int _index) { index = _index; } public void InstantiateIn(System.Web.UI.Control container) { RadComboBox realControl = new RadComboBox(); //Label realControl = new Label(); // Label much faster realControl.Enabled = true; realControl.Visible = true; realControl.ID = index.ToString(); realControl.Text = index.ToString(); container.Controls.Add(realControl); } } // GridView Extension, make empty rows with staticControls public class GridViewExtension : System.Web.UI.WebControls.GridView { public int rowSize; public bool EnableInsert; // Override the creation of childControls to create empty rows protected override int CreateChildControls(System.Collections.IEnumerable dataSource, bool dataBinding) { //create table Table table = new Table(); table.ID = this.ID; //create a new header row GridViewRow row = base.CreateRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal); //convert the exisiting columns into an array and initialize DataControlField[] fields = new DataControlField[this.Columns.Count]; this.Columns.CopyTo(fields, 0); this.InitializeRow(row, fields); table.Rows.Add(row); this.Controls.Add(table); while (rowSize != 0) { this.CreateInsertRow(rowSize, false); rowSize--; } return 0; } protected virtual void CreateInsertRow(int rowIndex, bool allowPaging) { GridViewRow row = this.CreateRow(rowIndex, -1, DataControlRowType.DataRow, DataControlRowState.Insert); row.ID = rowIndex.ToString(); DataControlField[] fields = new DataControlField[this.Columns.Count]; this.Columns.CopyTo(fields, 0); if (this.HasControls()) { int index = ((Table)this.Controls[0]).Rows.Count - (this.ShowFooter ? 1 : 0) - (allowPaging ? 1 : 0); ((Table)this.Controls[0]).Rows.AddAt(index, row); } this.InitializeRow(row, fields); } }}Hi,
I am developing a report screen for internal use on my company and I need to have the RadWindow functionality enabled, however I ran into an issue with positioning. I've searched a lot about it but couldn't find a solution for the issue.
For the record, I'm using VS2010, Framework 4.0, Windows 7, Telerik RadControls for ASP.NET AJAX Q1 2010 SP1.
I'm calling the rad window through radopen on client-site as you can see below (some parts of the script have been removed):
var ReportHandler = function () { var lnkExportToExcel; // other implementation var GetQueryString = function () { // other implementation }; var lnkExportToExcel_Click = function (event) { window.radopen("ExportOptions.aspx?" + GetQueryString(), "wndExportOptions"); return false; }; var EndRequestHandler = function () { InitializeReportHandler(); // other implementation }; var InitializeReportHandler = function () { lnkExportToExcel = $("#lnkExportToExcel"); lnkExportToExcel.bind("click", null, lnkExportToExcel_Click); // other implementation Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); }; this.Start = function () { InitializeReportHandler(); }; } $(function () { new ReportHandler().Start(); });
This is the markup of the content page which uses the script:
[...] <asp:Content ID="theBody" ContentPlaceHolderID="MainContent" runat="server"> <form id="frmReport" runat="server"> <asp:ScriptManager ID="transactionStatisticsScriptManager" runat="server" /> <telerik:RadWindowManager ID="tsWindowManager" Overlay="true" runat="server" Behaviors="Move,Close"> <Windows> <telerik:RadWindow ID="wndExportOptions" runat="server" Modal="true" Overlay="true" IconUrl="/images/procom.png" Title="Export Options" VisibleStatusbar="false" Height="210px" Width="300px" ShowContentDuringLoad="false"> </telerik:RadWindow> <telerik:RadWindow ID="wndViewDetails" runat="server" Modal="true" Overlay="true" IconUrl="/images/procom.png" Title="View Details" VisibleStatusbar="false" Height="450px" Width="900px" ShowContentDuringLoad="false"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager> <asp:UpdatePanel ID="transactionStatisticsUpdatePanel" runat="server"> </ContentTemplate> [...] <telerik:RadGrid ID="grdSearchResults" Width="968px" runat="server" [...Other definitions...]> <MasterTableView EnableNoRecordsTemplate="true" CommandItemDisplay="Top"> <CommandItemTemplate> <a id="lnkExportToExcel" href="#"> <img src="images/excel.gif" width="22px" height="22px" border="0px" alt="<%= GetGlobalResourceObject("TransactionStatistics", "ExportToExcelAlt").ToString() %>" title="<%= GetGlobalResourceObject("TransactionStatistics", "ExportToExcelAlt").ToString() %>"/> </a> </CommandItemTemplate> [...Rest of the Grid...] [...] </ContentTemplate> </asp:UpdatePanel> <script src="scripts/jquery-1.4.1.js" type="text/javascript"></script> <script src="scripts/ReportHandler.dev.js" type="text/javascript"></script> </form> </asp:Content>The rad window is being displayed when I click the excel image defined on the CommandItemTemplate section, however, it does not display it on the correct position. I haven't modified anything regarding the position of the window either through markup or css; I was expecting it to be centralized by default.
What happens is that it opens a bit past the center torwards the right side of the page. I can see that the overlay is also being displayed with a huge space (some sort of margin/padding or whatever) from the left side of the browser window, as if it was starting form the actual content page and not from the entire page (which is a merge from master page and content) so I would assume it does not support master page, but I hope is not the case.
Another very annoying issue I'm having is that when I close the RadWindow, if I click the button again, it opens even more on the right, and it happens subsequently until it's completely off the screen. The horizontal scroll bar has a lot more space to be rolled torwards the left and it increases every time I open one of these windows.
Also, if I try to drag the window around, it makes the horizontal scroll bar go nuts and gets even larger. As soon as I drop the window on the position I want, it moves itself to the right, completely going off the screen.
Please see the attached images to have an idea of what's happening on the UI.
img1.png shows the screen before I click the export to excel icon;
img2.png shows the screen when I click the export to excel icon for the first time;
img3.png shows the screen when I click the export to excel icon for the second time.
I haven't added more images, but the behaviour is the same, it keeps going torwards the right until it's completely off the screen and the scroll bar gets huge.
I really need some help with this guys.
Thanks
Update: It seems to have a normal behavior when I run the app using a one-monitor computer with small screen resolution (1024x768). The screenshots I sent previously where from a two-monitor computer on a 1920x1080 screen resolution. I have added an attachment (problem with safari, had to add attachment on other post of this same thread) which shows the expected behavior.
Protected
Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
For Each item As GridDataItem In rgLanguages.Items
Dim test As String = item("Language").Text
Next
End Sub

