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

Passing Parameter to Radwindow with grid

5 Answers 539 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jols
Top achievements
Rank 2
Jols asked on 23 Mar 2009, 06:48 AM

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  

5 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 23 Mar 2009, 09:44 AM
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.
0
Jols
Top achievements
Rank 2
answered on 23 Mar 2009, 11:25 AM
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 
0
Jols
Top achievements
Rank 2
answered on 23 Mar 2009, 12:29 PM
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
0
Princy
Top achievements
Rank 2
answered on 23 Mar 2009, 12:50 PM
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.
0
gc_0620
Top achievements
Rank 1
answered on 05 Mar 2010, 01:12 AM
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
Tags
Window
Asked by
Jols
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Jols
Top achievements
Rank 2
Princy
Top achievements
Rank 2
gc_0620
Top achievements
Rank 1
Share this question
or