using telerik
prometheus (telerik.web.ui dll)
C# 2008 and IE6
I have created a user control consisting of a rad grid and 2 rad windows.
I have a button in the user control that that loads the rad window using java script
//an alternative approach: find the needed RadWindow on the page and call its show() method
var oWnd = $find("<%=RelationshipsDialog.ClientID %>");
oWnd.SetSize(530 , 400);
oWnd.setUrl(url);
oWnd.show();
I have placed the user control on a an empty page to simplify my tests. the page as a scrptmanager on it.
on first click of the button the winodw opens with the correct size.
subsequent loads clicks of the button and the window opens in a different size about 15% wider. I placed an alert in the java script to read the size of the width after the ownd.show and it shows the width being the correct size of 530 px.
here is how the rad window is defined in the user control
<
telerik:RadWindow ID="RelationshipsDialog" runat="server" Title="CRM Assign Relationships"
Left="150px" Width="530px" Height="400px" ReloadOnShow="true" Modal="true" onclientclose="OnClientRelationshipClose" KeepInScreenBounds="True" />
Any help on correcting this would be appreciated
5 Answers, 1 is accepted
I tested your code but I was not able to reproduce the problem. Please open a new support ticket and send us a small sample project where this issue can be observed. We will check it and do our best to help.
Greetings,
Fiko
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I failed to mention that I have a rad ajax panel around my data grid and buttons to launch the popup windows.
This seems to be the source of the 1st windows width growing on the send and 3rd attmepts of launching it.
why would a an ajax panel effect the width of the rad window?
At this point we cannot tell what is the exact reason - to do this we need to have a better view over your exact setup and application logic. Please send us the project and we will provide you with the most appropriate solution.
Sincerely yours,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I am not sure how to open a ticket.
I cant see how to upload a file i will try and add each of the pages code to this forum note
if you click on the add button, then close the popup and click add again, the popup loads with a larger width
I think it may have to do with the size of the popups query string it is rather large.
the querystring provided is a sample of that is being passed into my real popup.
web control
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TelerikGridPopup.ascx.cs" Inherits="VS2008Sandpit.TelerikGridPopup" %> |
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
<script type="text/javascript"> |
function OnClientRelationshipClose(radWindow) |
{ |
refreshRelationshipGrid(null); |
} |
function refreshRelationshipGrid(arg) |
{ |
__doPostBack($get('<%= dgRelationships.ClientID %>').id,'REBINDRELATIONSHIPGRID'); |
} |
function ShowRelationshipAddPopup() |
{ |
url = "PopupWindow1.aspx?ContactID=58&CompanyID=0&AccountID=0&RelationshipID=0&CreateEmployee=0&PRName=lukeskywalker"; |
//url ="\\InvestorCRM\\WebForms\\Test.aspx?ContactID=58&CompanyID=0&AccountID=0&RelationshipID=0&CreateEmployee=0&PRName=lukeskywalker"; |
//an alternative approach: find the needed RadWindow on the page and call its show() method |
var oWnd = $find("<%=RelationshipsDialog.ClientID %>"); |
oWnd.SetSize(530 , 400); |
oWnd.setUrl(url); |
oWnd.show(); |
//window.radopen(url, "RelationshipsDialog"); |
return false; |
} |
function ShowRelationshipLockPopup() |
{ |
url = "PopupWindow2.aspx" |
//an alternative approach: find the needed RadWindow on the page and call its show() method |
var oWnd = $find("<%=LockDialog.ClientID %>"); |
oWnd.setUrl(url); |
oWnd.show(); |
//window.radopen(url, "RelationshipsDialog"); |
return false; |
} |
</script> |
</telerik:RadCodeBlock> |
<telerik:RadAjaxPanel ID="RadAjaxPanelRelationship1" runat="server" LoadingPanelID="LoadingPanel1"> |
<telerik:RadGrid |
ID="dgRelationships" |
runat="server" |
AllowPaging="True" |
PageSize="10" |
Width="80%" |
EnableViewState="true" |
skin="MatrixIms" |
EnableEmbeddedSkins="False" |
> |
<PagerStyle HorizontalAlign="left" NextPageImageUrl="../images/PagingNext.gif" |
PrevPageImageUrl="../images/PagingPrev.gif" |
NextPageText="" PrevPageText="" Mode="NextPrevAndNumeric" |
FirstPageImageUrl="" |
LastPageImageUrl="" ShowPagerText="false"> |
</PagerStyle> |
<MasterTableView |
AutoGenerateColumns="False" |
DataKeyNames="RelationshipsID" |
CommandItemDisplay="Top" |
> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridBoundColumn |
DataField="RelationshipsID" |
HeaderText="RelationshipsID" |
ReadOnly="True" |
SortExpression="RelationshipsID" |
UniqueName="RelationshipsID" |
Visible ="false" > |
</telerik:GridBoundColumn> |
<telerik:GridTemplateColumn |
UniqueName="Relationship" |
Visible=true > |
<ItemStyle HorizontalAlign="left" ></ItemStyle> |
<HeaderTemplate>Relationship</HeaderTemplate> |
<ItemTemplate> |
<a href="<%# DataBinder.Eval(Container.DataItem, "URL")%>" > |
<%# DataBinder.Eval(Container.DataItem, "RelationshipDesc")%></a> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridButtonColumn |
UniqueName="Delete" |
HeaderText="<span class='linkimagedark'></span> <input type='button' id='btnAddRelationship' value='Add' Class='ButtonLink' onclick='return ShowRelationshipAddPopup();'> |
<span class='linkimagedark'></span> <input type='button' id='btnLockRelationship' value='Lock' Class='ButtonLink' onclick='return ShowRelationshipLockPopup();'>" |
CommandName="Delete" |
Text="<img src='/AIMSGlobal/Images/Delete.gif' border ='0' >" |
confirmtext="Are you sure you want to remove this Relationship?" |
HeaderStyle-Width="120px" |
HeaderStyle-HorizontalAlign="Right" |
ItemStyle-HorizontalAlign="Right"> |
</telerik:GridButtonColumn> |
<telerik:GridButtonColumn |
UniqueName="Reinstate" |
HeaderText="" |
CommandName="Reinstate" |
Text="Reinstate" |
confirmtext="Are you sure you want to reinstate this Relationship?" |
HeaderStyle-Width="80px" |
HeaderStyle-HorizontalAlign="Right" |
ItemStyle-HorizontalAlign="Right" |
ItemStyle-Width ="80px" |
> |
</telerik:GridButtonColumn> |
<telerik:GridBoundColumn |
DataField="FormerCompany" |
HeaderText="Former Company" |
ReadOnly="True" |
SortExpression="FormerCompany" |
UniqueName="FormerCompany" |
Visible ="true" |
HeaderStyle-Width="220px" > |
</telerik:GridBoundColumn> |
</Columns> |
<CommandItemTemplate> |
</CommandItemTemplate> |
</MasterTableView> |
<ClientSettings> |
<Selecting AllowRowSelect="true" /> |
</ClientSettings> |
<FilterMenu EnableTheming="True"> |
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
</FilterMenu> |
</telerik:RadGrid> |
</telerik:RadAjaxPanel> |
<telerik:RadWindow ID="RelationshipsDialog" runat="server" Title="CRM Assign Relationships" |
Left="150px" Width="530px" Height="400px" ReloadOnShow="true" Modal="true" onclientclose="OnClientRelationshipClose" /> |
<telerik:RadWindow ID="LockDialog" runat="server" Title="CRM Lock Relationships" |
Left="150px" Width="530px" Height="300px" ReloadOnShow="true" Modal="true" onclientclose="OnClientRelationshipClose" /> |
web coontrol code behind
using System; |
using System.Collections; |
using System.Configuration; |
using System.Data; |
using System.Linq; |
using System.Web; |
using System.Web.Security; |
using System.Web.UI; |
using System.Web.UI.HtmlControls; |
using System.Web.UI.WebControls; |
using System.Web.UI.WebControls.WebParts; |
using System.Xml.Linq; |
using System.IO; |
namespace VS2008Sandpit |
{ |
public partial class TelerikGridPopup : System.Web.UI.UserControl |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
if (!IsPostBack) |
{ |
loadGrid(); |
} |
//Catch the java post back for refreshing the grid after the popup window has closed |
if (Request["__EVENTTARGET"] != null |
&& Request["__EVENTTARGET"] == dgRelationships.ClientID |
&& Request["__EVENTARGUMENT"] != null |
&& Request["__EVENTARGUMENT"].ToUpper().Equals("REBINDRELATIONSHIPGRID")) |
{ |
loadGrid(); |
} |
} |
private void loadGrid() |
{ |
DataSet ods = new DataSet(); |
string sxml = "<NewDataSet><Table><RelationshipsID>67</RelationshipsID>"; |
sxmlsxml = sxml + "<RelationshipDesc>luke skywalker is Family Relative of Disney account 1</RelationshipDesc> <URL>/InvestorCRM/WebForms/AccountDetail.aspx?AccountID=11&CompanyID=18</URL>" ; |
sxmlsxml = sxml + "<FormerCompany /> </Table> <Table> <RelationshipsID>121</RelationshipsID> <RelationshipDesc>luke skywalker is Family Relative of Prep Channel C</RelationshipDesc> <URL>/InvestorCRM/WebForms/CompanyDetails.aspx?Mode=2&TabInfo=Details&CompanyID=96</URL>"; |
sxmlsxml = sxml + "<FormerCompany /> </Table> <Table> <RelationshipsID>110</RelationshipsID> <RelationshipDesc>luke skywalker is Investment Contact for MPreepACC2</RelationshipDesc> <URL>/InvestorCRM/WebForms/AccountDetail.aspx?mode=2&TabInfo=Accounts&AccountID=37&CompanyID=96</URL> <FormerCompany /> "; |
sxmlsxml = sxml + "</Table> <Table> <RelationshipsID>117</RelationshipsID> "; |
sxmlsxml = sxml + "<RelationshipDesc>Prep Lead is Investement Advisor for luke skywalker</RelationshipDesc> <URL>/InvestorCRM/WebForms/ContactDetails.aspx?Mode=1&TabInfo=Details&ContactID=79</URL> <FormerCompany /> </Table></NewDataSet>"; |
ods.ReadXml(new StringReader(sxml)); |
dgRelationships.DataSource = ods.Tables[0]; |
dgRelationships.DataBind(); |
} |
} |
} |
popup page 1
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PopupWindow1.aspx.cs" Inherits="VS2008Sandpit.PopupWindow1" %> |
<%@ 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>Untitled Page</title> |
<script language="javascript" type="text/javascript" > |
function GetRadWindow() |
{ |
var oWindow = null; |
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog |
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well) |
return oWindow; |
} |
function CloseAndRedirect(url) |
{ |
GetRadWindow().Close(); |
GetRadWindow().BrowserWindow.RedirectToNewEmployee(url) ; |
} |
function CancelEdit() |
{ |
GetRadWindow().Close(); |
} |
function CloseAndRefreshGrid() |
{ |
GetRadWindow().Close(); |
//GetRadWindow().BrowserWindow.refreshGrid(null); |
} |
</script> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager> |
<table id="tblContacts" cellspacing="0" cellpadding="0" border="0" runat="server"> |
<tr> |
<td valign="bottom"> |
<input class="imsSubNavigationButton" id="btnRelationships" onmouseover="this.style.fontWeight='bold'" |
style="WIDTH: 95px; HEIGHT: 30px" onclick="RelationshipTabClick(this)" onmouseout="this.style.fontWeight='normal'" |
type="button" value="Relationships" runat="server"/> |
</td> |
</tr> |
</table> |
<table id="tblLock" style="BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none"> |
<tr> |
<td style="WIDTH: 250px; HEIGHT: 15px"><asp:label id="Label1" runat="server" |
CssClass="imsLabel1" Width="150px">Relationship |
Classification</asp:label></td> |
<td> |
<telerik:radcombobox id="RadRelationshipObj" runat="server" ShowMoreResultsBox="True" EnableLoadOnDemand="True" |
SkinsPath="~/RadControls/ComboBox/Skins" AllowCustomText="True" NoWrap="True" |
Width="336px" ></telerik:radcombobox> |
</td> |
</tr> |
</ table> |
<asp:label id="InjectScript" Runat="server"></asp:label> |
</div> |
</form> |
</body> |
</html> |
popup 1 code behind
using System; |
using System.Collections; |
using System.Configuration; |
using System.Data; |
using System.Linq; |
using System.Web; |
using System.Web.Security; |
using System.Web.UI; |
using System.Web.UI.HtmlControls; |
using System.Web.UI.WebControls; |
using System.Web.UI.WebControls.WebParts; |
using System.Xml.Linq; |
namespace VS2008Sandpit |
{ |
public partial class PopupWindow1 : System.Web.UI.Page |
{ |
protected int iCompanyID; |
protected int iContactID; |
protected int iAccountID; |
protected int iRelationshipID; |
protected int iShowCreateEmployee; |
protected string sPRName; |
protected void Page_Load(object sender, EventArgs e) |
{ |
iCompanyID = int.Parse(Request.QueryString["CompanyID"]); |
iContactID = int.Parse(Request.QueryString["ContactID"]); |
iAccountID = int.Parse(Request.QueryString["AccountID"]); |
iShowCreateEmployee = int.Parse(Request.QueryString["CreateEmployee"]); |
sPRName = Request.QueryString["PRName"]; |
iRelationshipID = int.Parse(Request.QueryString["RelationshipID"]); |
if (!IsPostBack) |
{ |
configureRelationshipObjectCombo(); |
} |
} |
private void configureRelationshipObjectCombo() |
{ |
//configure the drop down list |
Telerik.Web.UI.RadComboBoxItem li; |
li = new Telerik.Web.UI.RadComboBoxItem("Contact", "1"); |
RadRelationshipObj.Items.Add(li); |
li = new Telerik.Web.UI.RadComboBoxItem("Company", "2"); |
RadRelationshipObj.Items.Add(li); |
li = new Telerik.Web.UI.RadComboBoxItem("Account", "3"); |
RadRelationshipObj.Items.Add(li); |
li = new Telerik.Web.UI.RadComboBoxItem("Department", "4"); |
RadRelationshipObj.Items.Add(li); |
li = new Telerik.Web.UI.RadComboBoxItem("Employee", "5"); |
RadRelationshipObj.Items.Add(li); |
} |
} |
} |
popup 2
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PopupWindow2.aspx.cs" Inherits="VS2008Sandpit.PopupWindow2" %> |
<%@ 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>Untitled Page</title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> |
<telerik:RadComboBox ID="RadComboBox1" Runat="server"> |
</telerik:RadComboBox> |
</div> |
</form> |
</body> |
</html> |
using System; |
using System.Collections; |
using System.Configuration; |
using System.Data; |
using System.Linq; |
using System.Web; |
using System.Web.Security; |
using System.Web.UI; |
using System.Web.UI.HtmlControls; |
using System.Web.UI.WebControls; |
using System.Web.UI.WebControls.WebParts; |
using System.Xml.Linq; |
namespace VS2008Sandpit |
{ |
public partial class PopupWindow2 : System.Web.UI.Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
} |
} |
defualt page with control added
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
<%@ Register src="TelerikGridPopup.ascx" tagname="TelerikGridPopup" tagprefix="uc1" %> |
<!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>Untitled Page</title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> |
<uc1:TelerikGridPopup ID="TelerikGridPopup1" runat="server" /> |
</div> |
</form> |
</body> |
</html> |
We are aware of the reported problem and it occurs under IE only. We will do our best to fix this issue in one of the following updates, but for now you can avoid it by setting VisibleStatusbar to false .
All the best,
Fiko
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.