Radwindow size issue

2 posts, 0 answers
  1. Joe
    Joe avatar
    57 posts
    Member since:
    Mar 2013

    Posted 06 Jun 2013 Link to this post

    I had a hyperlink column in the radgrid, the link then open a radwindow.

    the code works fine that can open a radwindow, but the window size cannot resize no matter i set

    the following are my code:

    ASP

     

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">      
        <script type="text/javascript">
      
                function ShowSIMPER(id) {
                    window.radopen("HR_SIMPER_view.aspx?SIMPER_ID=" + id + "&UserID=0", "SIMPER_PDF" );
                    return false;
                }
     
            </script>
     
        </telerik:RadCodeBlock>

     

    <telerik:RadGrid ID="RadGrid2" runat="server" AllowFilteringByColumn="True"
                                          AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"  OnItemCreated="RadGrid2_ItemCreated"
                                          CellSpacing="0" DataSourceID="LDS_SIMPER" GridLines="None" Width="40%">
    <MasterTableView DataKeyNames="SIMPER_ID" DataSourceID="LDS_SIMPER">
    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
     
    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
    <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>
     
    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
    <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
     
        <Columns>
    <%--    <telerik:GridHyperLinkColumn Text="View/Edit" DataNavigateUrlFormatString="~/HR/HR_SIMPER_view.aspx?SIMPER_ID={0}&UserID=0" DataNavigateUrlFields="SIMPER_ID" UniqueName="HyperLinkColumn" AllowFiltering="false" Target="_blank">  
    </telerik:GridHyperLinkColumn>--%>
                    <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                        <ItemTemplate>
                            <asp:HyperLink ID="ViewLink" runat="server" Text="View"></asp:HyperLink>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="Valid_From" DataType="System.DateTime"
                FilterControlAltText="Filter Valid_From column" HeaderText="Valid_From"
                SortExpression="Valid_From" UniqueName="Valid_From" DataFormatString ="{0: dd-MMM-yyyy}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Valid_Till" DataType="System.DateTime"
                FilterControlAltText="Filter Valid_Till column" HeaderText="Valid_Till"
                SortExpression="Valid_Till" UniqueName="Valid_Till" DataFormatString ="{0: dd-MMM-yyyy}">
            </telerik:GridBoundColumn>
        </Columns>
     
    <EditFormSettings>
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
    </EditFormSettings>
     
    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
    </MasterTableView>
     
    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
     
    <FilterMenu EnableImageSprites="False"></FilterMenu>
                                      </telerik:RadGrid>
     
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow ID="SIMPER_PDF" runat="server" Title="View SIMPER Card" Height="700px"
                    Width="710px" Left="50px" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusBar="false"
                    Modal="false">
                </telerik:RadWindow>
            </Windows>
            </telerik:RadWindowManager>
     
                                      <asp:LinqDataSource ID="LDS_SIMPER" runat="server"
                                          ContextTypeName="dcLRDBDataContext" EntityTypeName=""
                                          TableName="db_Employee_Simper_Records" Where="UserID == @UserID and parent_id == null">
                                          <WhereParameters>
                                              <asp:QueryStringParameter Name="UserID" QueryStringField="UserID"
                                                  Type="Int32" />
                                          </WhereParameters>
                                      </asp:LinqDataSource>

     

    Code behind (VB)

    Protected Sub RadGrid2_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
        If TypeOf e.Item Is GridDataItem Then
            Dim editLink As HyperLink = DirectCast(e.Item.FindControl("ViewLink"), HyperLink)
            editLink.Attributes("href") = "javascript:void(0);"
            editLink.Attributes("onclick") = [String].Format("return ShowSIMPER('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("SIMPER_ID"), e.Item.ItemIndex)
        End If
    End Sub

     





  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Jun 2013 Link to this post

    Hi,

    I have tried to resize the window directly in aspx and in javascript, both worked as expected on my end.
    JS:
    function Open()
     {
       var wnd = window.radopen(null, "RadWindow1");
       wnd.SetSize("800", "500"); // to set size for RadWindow
     }

    OR
    ASPX:
    <telerik:RadWindow ID="RadWindow1" runat="server" Width="800px" Height="500px">
    </telerik:RadWindow>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top