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

Persist RadWindow in between postback

3 Answers 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ambuj
Top achievements
Rank 1
Ambuj asked on 10 Nov 2011, 09:32 AM
Hi,

I am using Radgrid, I have a colum with the html link upon clicking on that we are opening a radwindow , I have to preserve the rad windows even when the parent Radgrid refreshes ( Postback), I am using asp.net timer control to refresh the grid at a particular interval, as soon as the grid refreshes the windows disappear , Please suggest me how can I preserve the rad window during postback..

we are using DLL version of  2009.1.311.35.

I have done the below code to achieve that.

protected override object SaveViewState()
        {
            Control windowsManager = ctlVariables.FindControl("listPopupManager");
            Control windows = windowsManager.FindControl("variableValue");
            Object basestate =  base.SaveViewState();
            object[] allStates = new object[10];
              
            allStates[0] = windows.Visible;
            return allStates;
        }
  
        protected override void LoadViewState(object savedState)
        {
            if (savedState != null)
            {
                object[] myState = (object[])savedState;
                if (myState[0] != null)
                {
                    string visible = myState[1].ToString();
                } 
            }



Thanks,
Ambuj

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Nov 2011, 11:57 AM
Hello Ambuj,

One approach is to set the VisibleOnPgeLoad property to true based on the scenario. Another approach is to Show the RadWindow through registering a script from the server on refreshing the page.

Thanks,
Shinu.
0
Ambuj
Top achievements
Rank 1
answered on 11 Nov 2011, 06:44 AM
Can you please give some example on that?
0
Shinu
Top achievements
Rank 2
answered on 11 Nov 2011, 08:57 AM
Hello Ambuj,
Try the following approach.
protected void Page_Load(object sender, EventArgs e)
   {
        if (Session["WindowOpend"] == "true")
        {
         //set the visibleonpageload property here
        //  or calluse the RegisterStartUpScript to open the window.
        }
   }
protected override object SaveViewState()
   {
         . . . . . . .
         session["windowopened"]=true;
         return allStates;
    }

Thanks,
Shinu.
Tags
Grid
Asked by
Ambuj
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ambuj
Top achievements
Rank 1
Share this question
or