Passing Parameter to Radwindow with grid

6 posts, 1 answers
  1. Jols
    Jols avatar
    69 posts
    Member since:
    Mar 2009

    Posted 23 Mar 2009 Link to this post

    hello to all,

                    thanks again to sir shinu,

                   I would to ask help once again about passing parameter from another page to the radwindow with a grid inside, here's my scenario i have one page contains textboxes that user will input numbers to search the details related to the numbers inputed, for example the user input 123 to the txtbox name TxtAccountNumber.Text then he will click the button Search coming from page  then a radwindow will popup with a grid inside then load the record coming from the database.. how can i do that i tried to put the value from session inside the page but when the radwindow pop up the parameter there is null so its means no value has been carried by my session variable. anyway here's my code. please check and revise if ever..



     

    <

     

    telerik:RadWindowManager ID="RadWindowManager1" runat="server">

     

     

     

     

     

    <Windows>

     

     

     

     

     

    <telerik:RadWindow ID="RadWindow1" runat="server" Skin ="Vista" ReloadOnShow ="true"

     

     

    Modal ="true" OpenerElementID ="<%#btnSearch.ClientID%>"

     

     

    Title ="Transactional" NavigateUrl ="~/CHS/CHSTransactional.aspx?Accountno='123456789'" Width ="580px" Height ="300px" >

     

     

     

     

     

    </telerik:RadWindow>

     

     

     

     

     

    </Windows>

     

     

    </telerik:RadWindowManager>

     

     

     

    sample/codes is highly appriciated. 

    thanks to all  

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

    Posted 23 Mar 2009 Link to this post

    Hi Jols,

    One easy way to pass parameters is to supply query string parameters to the window URL. These parameters can be read on the server in the Page_Load method of the page being loaded in the window. I tried client side method radopen() to open the RadWindow instead of using OpenerElementID. See the example which I tried.

    Main page;
    ASPX:
    <telerik:radwindowmanager id="RadWindowManager1" runat="server" DestroyOnClose="true"
    </telerik:radwindowmanager> 
    <asp:TextBox ID="TextBox1" runat="server" Text="hi"></asp:TextBox> 
    <input id="Button1" type="button" value="Search" onclick="openRadWindow();" /> 

    JavaScript:
    <script type="text/javascript"
    function openRadWindow() 
        var value= document.getElementById("TextBox1").value; 
        var oWnd = radopen("Window.aspx?TxtAccountNumber=" +value, "RadWindow1" ); //Pass parameter using URL 
        oWnd.center(); 
    </script> 

    Page loading in RadWindow:
    CS:
    protected void Page_Load(object sender, EventArgs e) 
        string Acc_number = Page.Request.QueryString["TxtAccountNumber"]; // Get the parameter server side. 
        Response.Write(Acc_number); 

    Also refer the link,
    Using the URL Query String to Provide Arguments to RadWindow

    Thanks,
    Shinu.
  3. Jols
    Jols avatar
    69 posts
    Member since:
    Mar 2009

    Posted 23 Mar 2009 Link to this post

    shinu,

             i tried to run the my main page and click the button search there was an error saying microsoft jscript runtime error: 0bject required... what was that means, i just pasted your codes in my main page, and other codes was on the second page that will loaded to the radwindow..please help 
  4. Jols
    Jols avatar
    69 posts
    Member since:
    Mar 2009

    Posted 23 Mar 2009 Link to this post

    sir shinu

                   thanks a lot its workin now i got my parameter values coming from my  main page, but sir how can i set the modality of the radwindow here when it pop up?


    once again Thanks you so much
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Mar 2009 Link to this post

    Hi Jols,

    I guess you want to set the RadWindow as Modal. You can do this either by setting the property Modal="true" of RadWindowManager or by setting the client method set_modal().

    Option #1:
    <telerik:radwindowmanager id="RadWindowManager1" Modal="true" runat="server" DestroyOnClose="true">  
    </telerik:radwindowmanager> 

    Option #2:
    <script type="text/javascript">  
    function openRadWindow()  
    {  
        var accNumber= document.getElementById("TextBox1").value;  
        var cardNumber= document.getElementById("TextBox2").value;  
        var oWnd = radopen("Window.aspx?accoutnumber=" +accNumber + '&cardnumber=' + cardNumber, "RadWindow1" );  
        oWnd.center();  
        oWnd.set_modal(true)//Set the window as Modal window  
    }  
    </script> 

    Thanks,
    Princy.
  6. gc_0620
    gc_0620 avatar
    240 posts
    Member since:
    Feb 2008

    Posted 04 Mar 2010 Link to this post

    Shinu and Princy,

    Hi there. Is there any way to pass parameters to RadWindow from:

    1) Text Boxes that are in Master Table FormTemplate.
    2) Text Boxes that are in Master Table FormTemplate but in Master Content Page.
    3) Text Boxes that are in Detail Table (i.e. Child Table) FormTemplate.
    4) Text Boxes that are in Detail Table (i.e. Child Table) FormTemplate but in Master Content Page. 

    In your example i saw in function openRadWindow() , you are using:  var value= document.getElementById("TextBox1").value;
    What will be the syntax to capture the values of Textboxes that I mentioned in #1,#2, #3, and #4? That's what I am looking for.

    Thanks

    GC_0620
Back to Top