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

Issues with RadWindow

2 Answers 67 Views
Window
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 30 Aug 2010, 07:58 PM
Hi,

I'm having issues with the resizing of the RadWindw.  I have a grid that contains an edit link that the user clicks on the window.  However when the user closes the window and clicks edit for another row in the grid the RadWindow looses it setup size and the window is very small.

Thanks,
Here is the code that contains this information:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script language="javascript" type="text/javascript">
            function EditSchedule(taskid,rowIndex) {
                var grid = $find("<%=AstonishDataManagement.ClientID%>");
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);
 
                window.radopen("Datascheduledetail.aspx?TaskId=" + taskid, "UserListDialog"); ;
                return false;
            }
            function Openform() {
                window.radopen("Datascheduledetail.aspx", "UserListDialog");
                return false;
            }
        </script>
 
    </telerik:RadCodeBlock>
 
 
 <telerik:RadWindowManager Behaviors="Close,Resize,Maximize,Move" runat="server" ID="RWinMgr"
        ShowContentDuringLoad="true" DestroyOnClose="true" KeepInScreenBounds="true"
        VisibleStatusbar="false" Modal="true" Style="z-index: 8000;" Skin="Office2007">
        <Windows>
            <telerik:RadWindow ID="UserListDialog" runat="server" Title="Edit Schedule" Height="550px"
                Width="750px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                Modal="true" />
        </Windows>
    </telerik:RadWindowManager>
 
The grid caller partial code:
 
<telerik:RadGrid ID="AstonishDataManagement" runat="server" AllowPaging="True" AllowSorting="True"
        ClientSettings-Scrolling-AllowScroll="false" AutoGenerateColumns="False" GridLines="None"
        Skin="Office2007" PageSize="10" OnNeedDataSource="AstonishDataManagement_NeedDataSource"
        ClientSettings-Resizing-AllowColumnResize="false" OnInsertCommand="AstonishDataManagement_InsertCommand"
        OnUpdateCommand="AstonishDataManagement_UpdateCommand" OnCreateColumnEditor="AstonishDataManagement_OnCreateColumnEditor"       
        onitemcreated="AstonishDataManagement_ItemCreated"
        onitemcommand="AstonishDataManagement_ItemCommand">
        <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
        <MasterTableView Name="tblAstonishDataManagement" DataKeyNames="TaskId" AllowNaturalSort="false"
            CommandItemDisplay="None">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderStyle-Width="5px">
                    <ItemTemplate>
                        <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
                    </ItemTemplate>
Code-Behind:

  protected void AstonishDataManagement_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
                editLink.Attributes["href"] = "#";
                editLink.Attributes["onclick"] = String.Format("return EditSchedule('{0}','{1}');",
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["TaskId"], e.Item.ItemIndex);
            }
        }

Thanks,

2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 31 Aug 2010, 09:30 AM
Hello Joe,

In your code you have set DestroyOnClose to true. When this property is set to true, RadWindow’s object will be destroyed once the window is closed. This, however,  means that you will not be able to open that same RadWindow again until the whole page is reloaded. In such scenario, it will be best to either set all needed properties (width, height, modality, etc.) to the RadWindowManager or as an alternative – to use the client-side API and set them when opening the RadWindow.


Kind regards,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joe
Top achievements
Rank 1
answered on 31 Aug 2010, 01:01 PM
Awesome that worked.  Thank You very much.
Tags
Window
Asked by
Joe
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Joe
Top achievements
Rank 1
Share this question
or