Close Rad Window with Rad Grid Item Command

2 posts, 0 answers
  1. alias
    alias avatar
    9 posts
    Member since:
    May 2006

    Posted 19 Apr 2012 Link to this post

    hi telerik


    i have radgrid inside user control, this user cotrol inside  ContentTemplate of rad window,
    i want  select a row from rad grid and click a button on command button from grid and fire Rad Grid Item Command to store data to session and Close Rad Window.

    1. rad window in content page.
    2. script manager in master page

    please help me for close rad window after data store in session.


    plz HELP.

    sorry for mu weak english.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5705 posts

    Posted 23 Apr 2012 Link to this post

    Hi,

    You can inject a script from the code-behind that will close the RadWindow. More details about doing this are available in the following help article: http://www.telerik.com/help/aspnet-ajax/radwindow-troubleshooting-javascript-from-server-side.html. You will most likely need to traverse the Page controls tree to get the RadWindow object and its ClientID which you need for the $find() call. Since you are calling the script from a user control the syntax that will most likely work well for you is the following:
    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "someKey", "$find('" + yourRadWindow.ClientID + "').close();", true);

    which assumes the contents of the RadWnidow use Ajax and do not dispose the entire page.

    Kind regards,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top