Hello Friends
I am having a peculiar problem in my content page, one of my click event of a control I am creating the radwindows dynamically by following code :-
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
Telerik.Web.UI.RadWindow newWindow = new Telerik.Web.UI.RadWindow();
newWindow.VisibleOnPageLoad = true;
newWindow.OffsetElementID = "OffsetElement" + i.ToString();
newWindow.NavigateUrl = "http://www.sitefinity.com";
newWindow.Top = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[i][1]));
newWindow.Left = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[i][2]));
newWindow.Width = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[i][3]));
newWindow.Height = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[i][4]));
newWindow.Title = ds.Tables[0].Rows[i][0].ToString();
RadWindowManager1.RestrictionZoneID = SummaryDiv2.ClientID;
RadWindowManager1.Windows.Add(newWindow);
}
So they are populating fine, but when I am trying to save the window property like height, width etc I am not getting the radwindows in client side, for this please check the below mentioned javascript:-
function GetRADWinPrt()
{
var oManager = GetRadWindowManager(); // its coming NULL every time
var oActive = oManager.get_windows();
var winArray = new Array(oActive.length); //eventually length is also NULL
var strList = "";
for(var i = 0;i<oActive.length;i++)
{
//Check if Window is closed or Active
if(!(oActive[i].isClosed()))
{
var bound = oActive[i].getWindowBounds();
strList = strList + oActive[i].get_name() + "=" + bound.x +","+ bound.y + "," + bound.width + "," + bound.height + ";";
}
}
//Stored all active RADWindow properties in hidden field
document.getElementById(strHidden).value = strList;
alert(strList);
}
My RadwindowManager is
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleOnPageLoad="true"
VisibleTitlebar="true" VisibleStatusbar="false"
ReloadOnShow ="true" ShowContentDuringLoad="false" RestrictionZoneID="SummaryDiv2"
Overlay="true" Animation="Fade"
MinimizeZoneID="MyMinWins" OnClientCommand="oCCWindow" >
</telerik:RadWindowManager>
Also if I create RadWindow using window.radopen() in javascript then the above function i.e. GetRADWinPrt() works fine, but not work if I created my radWindow from Server side i.e. the for loop that I shown in the code snippet.
Could you please tell me where I am going wrong.
Thanks
Arindam R
I am having a peculiar problem in my content page, one of my click event of a control I am creating the radwindows dynamically by following code :-
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
Telerik.Web.UI.RadWindow newWindow = new Telerik.Web.UI.RadWindow();
newWindow.VisibleOnPageLoad = true;
newWindow.OffsetElementID = "OffsetElement" + i.ToString();
newWindow.NavigateUrl = "http://www.sitefinity.com";
newWindow.Top = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[i][1]));
newWindow.Left = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[i][2]));
newWindow.Width = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[i][3]));
newWindow.Height = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[i][4]));
newWindow.Title = ds.Tables[0].Rows[i][0].ToString();
RadWindowManager1.RestrictionZoneID = SummaryDiv2.ClientID;
RadWindowManager1.Windows.Add(newWindow);
}
So they are populating fine, but when I am trying to save the window property like height, width etc I am not getting the radwindows in client side, for this please check the below mentioned javascript:-
function GetRADWinPrt()
{
var oManager = GetRadWindowManager(); // its coming NULL every time
var oActive = oManager.get_windows();
var winArray = new Array(oActive.length); //eventually length is also NULL
var strList = "";
for(var i = 0;i<oActive.length;i++)
{
//Check if Window is closed or Active
if(!(oActive[i].isClosed()))
{
var bound = oActive[i].getWindowBounds();
strList = strList + oActive[i].get_name() + "=" + bound.x +","+ bound.y + "," + bound.width + "," + bound.height + ";";
}
}
//Stored all active RADWindow properties in hidden field
document.getElementById(strHidden).value = strList;
alert(strList);
}
My RadwindowManager is
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleOnPageLoad="true"
VisibleTitlebar="true" VisibleStatusbar="false"
ReloadOnShow ="true" ShowContentDuringLoad="false" RestrictionZoneID="SummaryDiv2"
Overlay="true" Animation="Fade"
MinimizeZoneID="MyMinWins" OnClientCommand="oCCWindow" >
</telerik:RadWindowManager>
Also if I create RadWindow using window.radopen() in javascript then the above function i.e. GetRADWinPrt() works fine, but not work if I created my radWindow from Server side i.e. the for loop that I shown in the code snippet.
Could you please tell me where I am going wrong.
Thanks
Arindam R