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

RadwindowManger problem

11 Answers 211 Views
Window
This is a migrated thread and some comments may be shown as answers.
Duy
Top achievements
Rank 1
Duy asked on 24 Dec 2009, 05:14 AM
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

11 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Dec 2009, 07:21 AM
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.
0
Svetlina Anati
Telerik team
answered on 24 Dec 2009, 10:52 AM
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.
0
Duy
Top achievements
Rank 1
answered on 28 Dec 2009, 11:59 PM
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
0
Svetlina Anati
Telerik team
answered on 29 Dec 2009, 12:16 PM
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.
0
Balakrishna Reddy
Top achievements
Rank 1
answered on 17 Jan 2013, 10:56 AM
i also struggle with same problem.so please provide me code snippet.
0
Duy
Top achievements
Rank 1
answered on 17 Jan 2013, 11:01 AM
Hi,

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

Regards,

Duy
0
Balakrishna Reddy
Top achievements
Rank 1
answered on 17 Jan 2013, 11:51 AM
<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.......
0
Princy
Top achievements
Rank 2
answered on 17 Jan 2013, 12:09 PM
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
0
Balakrishna Reddy
Top achievements
Rank 1
answered on 17 Jan 2013, 12:50 PM
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..
0
Princy
Top achievements
Rank 2
answered on 18 Jan 2013, 07:28 AM
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
0
Balakrishna Reddy
Top achievements
Rank 1
answered on 18 Jan 2013, 07:32 AM
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.......
Tags
Window
Asked by
Duy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Svetlina Anati
Telerik team
Duy
Top achievements
Rank 1
Balakrishna Reddy
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or