Rad Window Getting Poped Up on wrong events

2 posts, 0 answers
  1. Naresh
    Naresh avatar
    1 posts
    Member since:
    Oct 2012

    Posted 05 Oct 2012 Link to this post

    Hi

    I am opening a Radwindow in the edit command of RadGrid. The problem is that the Rad Window gets opened on other events also like delete command or DetailTableDataBind or changing radgrid list size through UI.. etc...

    Please let me know where I am going wrong.
     
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Oct 2012 Link to this post

    Hi Naresh,

    I suppose you are opening the window using VisibleOnPageLoad property. So the window reappears after each postback. Try the following code to open radwindow.
    C#:
    protected void RadGrid2_ItemCommand(object sender, GridCommandEventArgs e)
    {
       if (e.CommandName == RadGrid.EditCommandName)
       {
         string script = "function f(){$find(\"" + RadWindow1.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
       }
    }
    Please provide our code if it doesn't helps.

    Thanks,
    Princy.
Back to Top