This is a migrated thread and some comments may be shown as answers.

Error from Dynamically Adding RadWindows to

1 Answer 79 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 1
Ricky asked on 18 Dec 2007, 07:31 AM
Hi, to add dynamically RadWindow for each link button wihtin a row of RadGrid, I implement following code:

 if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            LinkButton btn = (LinkButton)(item["DisplayName"].FindControl("DisplayNameLinkBtn"));
            // Dynamically creating a RadWindow
            RadWindow window = new RadWindow();
            window.ID = "RadWindow_" + item.ItemIndex;
            RadWindowHolder.Controls.Add(window);
            window.OpenerElementId = btn.ClientID;
            window.OffsetElementId = btn.ClientID;
            window.Width = Unit.Pixel(500);
            window.Height = Unit.Pixel(400);
            // Generate Nevigation URL
            StringBuilder windowUrlSB = new StringBuilder(50);
            windowUrlSB.Append("http://");
            windowUrlSB.Append(Request.Url.Host + Request.ApplicationPath);
            windowUrlSB.Append("/DesktopModules/iBossWatchList/JobSeekerDetail.aspx?AliasID=");
            windowUrlSB.Append(item["AliasID"].Text);
            window.NavigateUrl = windowUrlSB.ToString();

However, this will cause client-side javascript error: requiring object (translated form my native language) and VS debugger stops here:

<body>
...
...
<script type='text/javascript'>/*<![CDATA[*/
RadWindowInitialize( "dnn_ctr514_ViewiBossWatchList_RadWindow_0", "RadWindow_0", "radWindow_dnn_ctr514_ViewiBossWatchList_RadWindow_0", false, "
http://localhost/DNN_iWork_Dev/DesktopModules/iBossWatchList/JobSeekerDetail.aspx?AliasID=1", "", "", "", "", "", "500px", "400px",
"", "" ,"", "", 0, 127, 1, null, null, null, null, "dnn_ctr514_ViewiBossWatchList_WatchListGrid_ctl01_ctl04_DisplayNameLinkBtn", "dnn_ctr514_ViewiBossWatchList_WatchListGrid_ctl01_ctl04_DisplayNameLinkBtn", null,null,null,"" );


Is there any setting I ignore?

Thanks a million.
Ricky.

1 Answer, 1 is accepted

Sort by
0
Ricky
Top achievements
Rank 1
answered on 18 Dec 2007, 07:49 AM
Hi, this problem is caused my ignorance.

I should add RadWindow to RadWindowManager instead of a PlaceHolder.

Ricky.
Tags
Window
Asked by
Ricky
Top achievements
Rank 1
Answers by
Ricky
Top achievements
Rank 1
Share this question
or