RadwindowManger problem

12 posts, 0 answers
  1. Duy
    Duy  avatar
    68 posts
    Member since:
    Apr 2009

    Posted 23 Dec 2009 Link to this post

    Hi,

    I have a radwindowmanager problem as implementing with radscheduler.

    On the appointment is clicked, the window's visibleonpageload set to be true.  After the things are done and  the window is closed.  However, each time radscheduler is navigated, the window is popped up again.  I am not sure what causes the problem.

    I set the ajax update control(radscheduler, radwindowmanager).

    Regards,

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

    Posted 24 Dec 2009 Link to this post

    Hello Duy,

    When we set VisibleOnPageLoad property to True, the window opens for every postbacks. So one suggestion to avoid this behaviour, invoke a postback when closing the window and set the VisibleOnPageLoad property to False for that window.

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 24 Dec 2009 Link to this post

    Hi Duy,

    When a RadWindow is declared in  RadWindowManager it preserves its ViewState which was not so in previous versions. This could lead to backwards incompatibility when the VisibleOnPageLoad property is used in this configuration with the idea to show the RadWindow only once. Possible solutions for this case are the following ones:

    • Set EnableViewState = "false" for the RadWindowManager
    • Reset the VisibleOnPageLoad property to false with code when suitable, depending on the particular scenario
    • Show the RadWindow through registering a script from the server instead.


    Sincerely yours,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Duy
    Duy  avatar
    68 posts
    Member since:
    Apr 2009

    Posted 28 Dec 2009 Link to this post

    Thanks All,

    I approached the solution which Svetlina suggested.  It works with EnableViewState = false and reset VisibleOnPageLoad = false according to the trigged event.  Will try another way which open the window through the script.

    cheers,

    Duy
  6. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 29 Dec 2009 Link to this post

    Hello Duy ,

    As far as I understood, my suggestion about setting EnableViewState="false" for the manager worked for your case. If so, I am glad I could help and I recommend to stick to this solution because in my opinion it is better than executing scripts from the server (there are different scenarios when executing the scripts and this might cause more time and effort and also does not have benefits in this case and also you will get better performance by disabling the ViewState).

    In case you need further assistance or you have additional questions, do not hesitate to contact us again.

    Sincerely yours,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Balakrishna Reddy
    Balakrishna Reddy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 17 Jan 2013 Link to this post

    i also struggle with same problem.so please provide me code snippet.
  8. Duy
    Duy  avatar
    68 posts
    Member since:
    Apr 2009

    Posted 17 Jan 2013 Link to this post

    Hi,

    set the radwindowmange.visiblepageload = false on the page load of codebehind.

    Regards,

    Duy
  9. Balakrishna Reddy
    Balakrishna Reddy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 17 Jan 2013 Link to this post

    <EditFormSettings EditFormType="Template" PopUpSettings-Width="40%" InsertCaption="Add New product Paper details">
                                    <EditColumn ButtonType="ImageButton">
                                    </EditColumn>
                                    <FormTemplate>
                                        <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true">
                                            <ContentTemplate>
                                                ProductName:
                                                <asp:DropDownList ID="cboProduct" runat="server" Width="30%">
                                                </asp:DropDownList>
                                                <div class="listNav">
                                                    ProductType:
                                                    <telerik:RadListBox ID="lstProductType" runat="server" CheckBoxes="true" DataTextField="ProductType">
                                                    </telerik:RadListBox>
                                                    PaperType:
                                                    <telerik:RadListBox ID="lstPaperType" runat="server" CheckBoxes="true" DataTextField="PaperType">
                                                    </telerik:RadListBox>
                                                    <br />
                                                    IsActive:
                                                    <asp:CheckBox ID="IsActive" runat="server" />
                                                </div>
                                                <br />
                                                <telerik:RadButton ID="lstSubmit" runat="server" ButtonType="StandardButton" Text="Insert"
                                                    CommandName="PerformInsert">
                                                </telerik:RadButton>
                                                <telerik:RadButton ID="lstCance" runat="server" ButtonType="StandardButton" CommandName="Cancel"
                                                    Text="Cancel">
                                                </telerik:RadButton>
                                            </ContentTemplate>
                                        </telerik:RadWindow>
                                    </FormTemplate>
                                </EditFormSettings>.
    ---------------------------------------------------------------------------------
    protected
    void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
        {
            GridEditFormItem item = (GridEditFormItem)e.Item;
            RadWindow window = (RadWindow)item.FindControl("RadWindow1");
               rdWindow.VisibleOnPageLoad = true;
            TextBox txt = (TextBox)window.ContentContainer.FindControl("TextBox3");
            DropDownList ddl = (DropDownList)window.ContentContainer.FindControl("cboProduct");
        }
    }

    my code is like this.when i am closing the window using Colse(X).. after that when ever i am changing the page index the popup Radwindow is again open.if i remove"rdWindow.VisibleOnPageLoad = true;" this window is not open at first time also...So please help me...........

    Thanks in Advance.......
  10. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Jan 2013 Link to this post

    Hi,

    Try the following code to open RadWIndow.
    C#:
    protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            LinkButton btn = (LinkButton)item["edit"].Controls[0];
            btn.Attributes.Add("onclick", "open();return false;");
        }
    }
    JS:
    function open()
    {
     var oWnd = radopen("", "RadWindow1");
    }

    Thanks,
    Princy
  11. Balakrishna Reddy
    Balakrishna Reddy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 17 Jan 2013 Link to this post

    hi Princy.
      i am getting the following error when i am trying to execute your code.
    Unable to cast object of type 'Telerik.Web.UI.GridEditFormInsertItem' to type 'Telerik.Web.UI.GridDataItem'...please help me..
  12. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Jan 2013 Link to this post

    Hi,

    Unfortunately I cannot replicate the issue at my end. Here is the full code that I tried which worked as expected.
    aspx:
    <telerik:RadGrid ID="RadGrid2" AutoGenerateColumns="false" runat="server" DataSourceID="SqlDataSource2"OnItemDataBound="RadGrid2_ItemDataBound" >
     <MasterTableView  CommandItemDisplay="Top">
      <EditFormSettings EditFormType="Template">
        <FormTemplate>
          <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true">
              <ContentTemplate>
                 <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
              </ContentTemplate>
          </telerik:RadWindow>
        </FormTemplate>
       </EditFormSettings>
        <Columns>
          <telerik:GridEditCommandColumn  UniqueName="edit" ButtonType="LinkButton"></telerik:GridEditCommandColumn>
       </Columns>
     </MasterTableView>
    </telerik:RadGrid>

    C#:
    protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            LinkButton btn = (LinkButton)item["edit"].Controls[0];
            btn.Attributes.Add("onclick""open();return false;");
        }
    }
    JS:
    function open()
    {
     var oWnd = radopen("""RadWindow1");
    }

    Thanks,
    Princy
  13. Balakrishna Reddy
    Balakrishna Reddy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 18 Jan 2013 Link to this post

    Hi,
    Thanks for your help,But the code which you provided is not working..Actually what i want means i want to display a RadWindow in insert mode of a RadGrid and i want to display data in editform type in edit mode of a RadGrid...So please help me.......
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017