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

Rad Window Wizard

1 Answer 98 Views
Window
This is a migrated thread and some comments may be shown as answers.
Laura
Top achievements
Rank 1
Laura asked on 31 Oct 2008, 05:37 AM
I am attempting to use the rad window control to create a wizard to create users for a software system. I looked at the demo, and I am trying to fashion it after that. I will open up a radwindow, and as the user progresses, he will click a button to go forward and backward using the same window, but reloading a new URL and passing arguments along the way. I see you can use either arguments or querystrings. From what I believe, you can only use the window arguments on the client side, and you can only use the querystring on the server. Since some of my code on page load is on the client, and some is on the server, I have to send both args and querystrings back and forth since I want my data to persist from page to page and back again. It appears that my page is loading twice which I don't know why. On my first page, I only have 3 text boxes, and if the user goes to the second page, and then returns the first, even though I am reloading the textboxes from the querystrings or args, the textboxes are empty. That is the first of my problems. I am attaching my code to see if anyone can shed some light for me. If anyone knows the best way to set up a wizard this way with persisting data, please let me know. Thank you,
Laura

Main aspx page to create radwindow and go to first page of wizard:
  function openWin(OrderDetailID) {

                var urlArgs = cbeGetURLArguments();

                var sbOID = parseInt(urlArgs['sbOID']);
                var queryODID = parseInt(urlArgs['sbODID']);
                var sbproductid = parseInt(urlArgs['sbproductid']);
                var SAPID = urlArgs['SAPID'];

                var txtbxODID = document.getElementById('TextBoxOrderDetailID').value;
                var txtbxProduct = document.getElementById('TextBoxProduct').value;
                if (txtbxODID == null)
                    sbODID = queryODID;
                else
                    sbODID = txtbxODID;

                //Create a new Object to be used as an argument to the radWindow
                var arg = new Object();
                //Using an Object as a argument is convenient as it allows setting many properties.
                arg.ODID = txtbxODID;
                arg.OID = sbOID;
                arg.SAPID = SAPID;
                arg.productid=sbproductid;
                arg.product = txtbxProduct;
                arg.temptablename = "";
                arg.package_cd = "NTB";
                arg.licensePrice = 50;
                arg.numUsers = 0;
                arg.email = "";

                var windowURL = "v8Wizard.aspx?sbODID=" + sbODID + "&sbproductid=" + sbproductid + "&SAPID=" + SAPID + "&sbProduct=" + txtbxProduct;
         
                var oWnd = radopen(windowURL, "RadWindow1");
                //  oWnd.setSize(700, 500);
                oWnd.setSize(600, 680);
                oWnd.center();

                //Set the argument object to the radWindow        
                oWnd.Argument = arg;

                //set a function to be called when RadWindow is closed
                oWnd.add_close(OnClientClose);
            }
            function OnClientClose(oWnd) {
                //get the transferred arguments
                // var OrderDetailID = oWnd.argument.OID;
                // var seldate = oWnd.argument.selDate;

                var numUsers = oWnd.argument.numUsers;
                if (numUsers <= 0)
                    numUsers = 0;
                var order = document.getElementById("order");
                order.innerHTML = numUsers + " users created ";
            }

                                            
        </script>
   <telerik:RadFormDecorator ID="formDecorator1" runat="server" DecoratedControls="All" Skin="Office2007" />
    ........
    
 
   <div style="height:40px;width:50px;">
       <button id="WizardButton" style="width:170px;" onclick="openWin('<%# TextBoxOrderDetailID.Text %>'); return false;">Create Users</button>
    </div>
   <telerik:RadWindowManager ID="wizardWindowManager"                             


First page of wizard that opens when button on main default.aspx page is  clicked:

<body onload="getArgs()" >
   <form id="Form2" method="post" runat="server">
   

        <script  type="text/javascript">

            function centerUpdatePanel() {
                centerElementOnScreen(document.getElementById("RadAjaxLoadingPanel1"));
            }

            function centerElementOnScreen(element) {
                var scrollTop = document.body.scrollTop;
                var scrollLeft = document.body.scrollLeft;

                var viewPortHeight = document.body.clientHeight;
                var viewPortWidth = document.body.clientWidth;

                if (document.compatMode == "CSS1Compat") {
                    viewPortHeight = document.documentElement.clientHeight;
                    viewPortWidth = document.documentElement.clientWidth;

                    scrollTop = document.documentElement.scrollTop;
                    scrollLeft = document.documentElement.scrollLeft;
                }

                var topOffset = Math.ceil(viewPortHeight / 2 - element.offsetHeight / 2);
                var leftOffset = Math.ceil(viewPortWidth / 2 - element.offsetWidth / 2);

                var top = scrollTop + topOffset - 40;
                var left = scrollLeft + leftOffset - 70;

                element.style.position = "absolute";
                element.style.top = top + "px";
                element.style.left = left + "px";
            }

            function getArgs() {
                var oWnd = GetRadWindow();
                oArgs = oWnd.Argument;
                
                //use the arguments to set the textboxes
                
               var odid = document.getElementById("odid");
               var productname = document.getElementById("productname");
               var SAPID = document.getElementById("SAPID");
               var oid = document.getElementById("oid");
               var productid = document.getElementById("productid");
               var temptablename = document.getElementById("temptablename");
               var package_cd = document.getElementById("package_cd");
               var licensePrice = document.getElementById("licensePrice");
               var numUsers = document.getElementById("numUsers");
               var email = document.getElementById("email");

               odid.value = oArgs.ODID;
               productname.value = oArgs.product;
               SAPID.value = oArgs.SAPID;
               oid.value = oArgs.OID;
               productid.value = oArgs.productid;
               temptablename.value = oArgs.temptablename;
               package_cd.value = oArgs.package_cd;
               if(oArgs.licensePrice > 0)
                   licensePrice.value = oArgs.licensePrice;
                if(oArgs.numUsers > 0)
                    numUsers.value = oArgs.numUsers;
                if(oArgs.email != "")
                    email.value = oArgs.email;
                                     
            }
        
         function cbeGetURLArguments() {
               var idx = location.href.indexOf('?');
               var params = new Array();
               if (idx != -1) {
                   var pairs = location.href.substring(idx + 1, location.href.length).split('&');
                   for (var i = 0; i < pairs.length; i++) {
                       nameVal = pairs[i].split('=');
                       params[i] = nameVal[1];
                       params[nameVal[0]] = nameVal[1];
                   }
               }
               return params;
           }
        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        function goToNextStep() {
          // validate fields
            var isValid = validate();
            if (!isValid)
                return;
                         
                var oWnd = GetRadWindow();

                var oargs = oWnd.Argument;   // these are the arguments that were sent by the default.aspx
                
                var odid = document.getElementById("odid");
                var productname = document.getElementById("productname");
                var SAPID = document.getElementById("SAPID");
                var oid = document.getElementById("oid");
                var productid = document.getElementById("productid");
                var temptablename = document.getElementById("temptablename");
                var package_cd = document.getElementById("package_cd");
                var licensePrice = document.getElementById("licensePrice");
                var numUsers = document.getElementById("numUsers");
                var email = document.getElementById("email");
                
                oArgs.ODID = odid.value;
                oArgs.product = productname.value;
                oArgs.SAPID = SAPID.value ;
                oArgs.OID = oid.value ;
                oArgs.productid = productid.value;
                oArgs.temptablename = temptablename.value;
                oArgs.package_cd =package_cd.value;
                oArgs.licensePrice = licensePrice.value;
                oArgs.numUsers = numUsers.value;
                oArgs.email = email.value;
                
                // sending orderdetailid, productid and sapid in querystring because that is needed on page load before client page load is called
                // everything else is set up in the args.
                var windowURL = "v8Wizard_Page2.aspx?sbODID=" + odid.value + "&sbproductid=" + productid.value + "&SAPID=" + SAPID.value
                   + "&product=" + productname.value + "&ttt=" + temptablename.value;
              //  var windowURL = "v8Wizard_Page2.aspx?sbODID=" + ODID + "&wnd=" + oWnd + "&sbOID=" + OID + "&SAPID=" + SAPID + "&product=" + PRODUCT +
              //          "&email=" + EMAIL + "&numUsers=" + NUMUSERS + "&licenseprice=" + PRICE ;
                oWnd.setUrl(windowURL);

            }

            function validate() {
                var errorMessage = "The following items must be fixed before going to the next step:\r\n";
                var error = 0;
                var blankEmail = 0;
                if (document.getElementById('licensePrice').value == "") {
                    errorMessage = errorMessage + "\r\n * Price cannont be blank";
                    error = 1;
                 }
                if (document.getElementById('numUsers').value == "") {
                    errorMessage = errorMessage + "\r\n * Number of users can not be blank";
                    error = 1;
                }
                if (document.getElementById('email').value == "") {
                    errorMessage = errorMessage + "\r\n * Email  can not be blank";
                    blankEmail = 1;
                    error = 1;
                }
                if (blankEmail == 0) {
                    var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
                    var emailid = document.getElementById('email').value;
                    var matchArray = emailid.match(emailPat);
                    if (matchArray == null) {
                        errorMessage = errorMessage + "\r\n * Your email address seems incorrect. Please try again.";
                        error = 1;
                    }
                }
                if (error == 0)
                    return true;
                else {
                    alert(errorMessage);
                    return false;
                }
            }    
        function returnToParent()
        {
             //create the argument that will be returned to the parent page
             var oArg = new Object();

             //get the name
             var numField = document.getElementById("numUsers");
             var numUsers = numField.value;
             oArg.numUsers = numUsers;
        
            //get a reference to the RadWindow
            var oWnd = GetRadWindow();
            
            //set the argument to the RadWindow
            oWnd.argument = oArg;
            //close the RadWindow            
            if(numUsers.Text != "")
            {
                oWnd.close();
            }
            else
            {
                alert("Please enter number");
            }
        }
        
        </script>
  <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" >
   <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True" OutputCompression="AutoDetect">
   </telerik:RadScriptManager>
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" >
       <ClientEvents OnRequestStart="centerUpdatePanel();"></ClientEvents>
                <AjaxSettings>
                   
                     
                   
                    <telerik:AjaxSetting AjaxControlID="numUsers">
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="licensePrice">
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="email">
                    </telerik:AjaxSetting>
                   
                     
                   
                </AjaxSettings>
    </telerik:RadAjaxManager>
    
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"  Transparency="20"  MinDisplayTime="1000" IsSticky="true" height="200" width="400px"  >
         <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0;"/>
    </telerik:RadAjaxLoadingPanel>
        
        <asp:Label  ID="title" runat="server"  Font-Names="Monotype Corsiva" Font-Size="XX-Large" CssClass="wizardLbl"></asp:Label>
        
        
            
                <br /><br /><br /><br /><br /><br /><br />
        <telerik:RadFormDecorator ID="formDecorator1" runat="server" DecoratedControls="All" Skin="Office2007" />
                          
        <telerik:RadNumericTextBox ID="numUsers" runat="server" Width="300px"   CssClass ="textboxes" Height="10px"  
                       EnabledStyle-Width="200px" Label="Number of users:"  LabelCssClass="labels">
           <NumberFormat DecimalDigits="0"   />
        </telerik:RadNumericTextBox>
        
        <asp:RequiredFieldValidator id="numUserValidator" runat="server" ErrorMessage="* Enter number of users to add"   
               ForeColor="Gold" Display="Static" ControlToValidate= "numUsers" ></asp:RequiredFieldValidator>
       <br />      
        
        <telerik:RadNumericTextBox  ID="licensePrice" runat="server" Culture="English (United States)" Type="Currency"  Height="10px" Width="300px" CssClass="textboxes"
             Label="License price:" LabelCssClass="labels" EnabledStyle-Width="200px">
        </telerik:RadNumericTextBox>
            <asp:RequiredFieldValidator id="priceValidator" runat="server" ErrorMessage="* Enter number of users to add" ForeColor="Gold"  
                    Display="Static" ControlToValidate= "licensePrice" ></asp:RequiredFieldValidator>
       <br />        
         <telerik:RadTextBox ID="email" runat="server" Visible="true"   Width="300px" Height="10px"  EnabledStyle-Width="200px"
              CssClass="textboxes"  Label="Email Address:" LabelCssClass="labels"></telerik:RadTextBox>
          <asp:RequiredFieldValidator id="requiredEmail" runat="server" ErrorMessage="* Email required"  ForeColor="Gold"  
                   Display="Dynamic" ControlToValidate= "email"   ></asp:RequiredFieldValidator>
          <asp:RegularExpressionValidator Runat="server" ErrorMessage="* Invalid E-mail Address" ID="formatEmail" ForeColor="Gold"  
                   Display="Dynamic" ControlToValidate="email" ValidationExpression=".+@.+\.[a-z]+"  ></asp:RegularExpressionValidator>
        <br />                         
        
           
              
         
                <div style="padding-left: 15px;">
                    <br />
        <div class="wizardRight">
      
      <asp:Button  ID="continueButton" runat="server"  style="width:100px;" OnClientClick="goToNextStep();" Text="Next"
             CausesValidation="true"  ></asp:Button>
         
       </div>
    
      
     </div>

    
<div style="position:absolute; left:0px; bottom:0px;" >    
                        
  <asp:TextBox ID="odid" Visible="true" runat="server"  Width="0" Height="0" style="border: 0px solid #778899;"></asp:TextBox>
  <asp:TextBox ID="productname" Visible="true" runat="server"  Width="0" Height="0" style="border: 0px solid #778899;"></asp:TextBox>
  <asp:TextBox ID="SAPID" Visible="true" runat="server"  Width="0" Height="0" style="border: 0px solid #778899;"></asp:TextBox>
  <asp:TextBox ID="oid" Visible="true" runat="server"  Width="0" Height="0" style="border: 0px solid #778899;"></asp:TextBox>
  <asp:TextBox ID="productid" Visible="true" runat="server"  Width="0" Height="0" style="border: 0px solid #778899;"></asp:TextBox>
  <asp:TextBox ID="temptablename" Visible="true" runat="server"  Width="0" Height="0" style="border: 0px solid #778899;"></asp:TextBox>
  <asp:TextBox ID="package_cd" Visible="true" runat="server"  Width="0" Height="0" style="border: 0px solid #778899;"></asp:TextBox>
    <asp:TextBox ID="companyName" Visible="true" runat="server"  Width="0" Height="0" style="border: 0px solid #778899;"></asp:TextBox>
 </div>
  <asp:SqlDataSource ID="LicensePriceDataSource" runat="server"
        ConnectionString="<%$ ConnectionStrings:ContentCentralConnectionString %>"
           SelectCommand="isp_sbGetLicensePrice"
    SelectCommandType="StoredProcedure" >
        <SelectParameters>
            <asp:ControlParameter ControlID="SAPID" Name="SAPID" PropertyName="Text"
                Type="String" />
            <asp:ControlParameter ControlID="odid" Name="sbOrderDetailID"
                PropertyName="Text" Type="Int32" />
            <asp:ControlParameter ControlID="productid" Name="sbProductID"
                PropertyName="Text" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    
  </telerik:RadAjaxPanel>
  </form>
  </body>
  </html>

And corresponding C#:

public partial class v8Wizard : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
     // Product.Text = Request.QueryString["sbProduct"];
     // ODID.Text = Request.QueryString["sbODID"];
        if (Page.IsPostBack == false)
        {
            title.Text = Request.QueryString["sbProduct"];
            odid.Text = Request.QueryString["sbODID"];
            productid.Text = Request.QueryString["sbproductid"];
            SAPID.Text = Request.QueryString["SAPID"];

            //call stored procedure to get license price
            double price = getLicensePrice();
            if (licensePrice.Value == null)
                licensePrice.Value = price;
        }
       
    }

And second page of wizard that when this goes back to my first page, the textboxes are always blank:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
        <link rel="stylesheet" href="v8Wizard.css" type="text/css" />
</head>
<body onload="getArgs()" >
    <form id="form1" runat="server">
    
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" >
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True" OutputCompression="AutoDetect">
        </telerik:RadScriptManager>

        <script type="text/javascript">

            var oArgs;
            
           function getArgs() {
                var oWnd = GetRadWindow();
                oArgs = oWnd.Argument;
                
                //use the arguments to set the textboxes
                
               var odid = document.getElementById("odid");
               var productname = document.getElementById("productname");
               var SAPID = document.getElementById("SAPID");
               var oid = document.getElementById("oid");
               var productid = document.getElementById("productid");
               var temptablename = document.getElementById("temptablename");
               var package_cd = document.getElementById("package_cd");
               var licensePrice = document.getElementById("licensePrice");
               var numUsers = document.getElementById("numUsers");
               var email = document.getElementById("email");

               odid.value = oArgs.ODID;
               productname.value = oArgs.product;
               SAPID.value = oArgs.SAPID;
               oid.value = oArgs.OID;
               productid.value = oArgs.productid;
               if(temptablename.value == "")
                 temptablename.value = oArgs.temptablename;
               package_cd.value = oArgs.package_cd;
               licensePrice.value = oArgs.licensePrice;
               numUsers.value = oArgs.numUsers;
               email.value = oArgs.email;
               
            }
        
         function cbeGetURLArguments() {
               var idx = location.href.indexOf('?');
               var params = new Array();
               if (idx != -1) {
                   var pairs = location.href.substring(idx + 1, location.href.length).split('&');
                   for (var i = 0; i < pairs.length; i++) {
                       nameVal = pairs[i].split('=');
                       params[i] = nameVal[1];
                       params[nameVal[0]] = nameVal[1];
                   }
               }
               return params;
           }
        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        function goBackOneStep() {

            var oWnd = GetRadWindow();

            var oargs = oWnd.Argument;

            var odid = document.getElementById("odid");
            var productname = document.getElementById("productname");
            var SAPID = document.getElementById("SAPID");
            var oid = document.getElementById("oid");
            var productid = document.getElementById("productid");
            var temptablename = document.getElementById("temptablename");
            var package_cd = document.getElementById("package_cd");
            var licensePrice = document.getElementById("licensePrice");
            var numUsers = document.getElementById("numUsers");
            var email = document.getElementById("email");

            oArgs.ODID = odid.value;
            oArgs.product = productname.value;
            oArgs.SAPID = SAPID.value;
            oArgs.OID = oid.value;
            oArgs.productid = productid.value;
            oArgs.temptablename = temptablename.value;
            oArgs.package_cd = package_cd.value;
            oArgs.licensePrice = licensePrice.value;
            oArgs.numUsers = numUsers.value;
            oArgs.email = email.value;

            // sending orderdetailid, productid and sapid in querystring because that is needed on page load before client page load is called
            // everything else is set up in the args.
            var windowURL = "v8Wizard.aspx?sbODID=" + odid.value + "&sbproductid=" + productid.value + "&SAPID=" + SAPID.value + "&product=" + productname.value;
            oWnd.setUrl(windowURL);
        }
        function goToNextStep() {
            // validate fields
            var isValid = validate();
            if (!isValid)
                return;

            var urlArgs = cbeGetURLArguments();

            var OID = parseInt(urlArgs['sbOID']);
            var ODID = parseInt(urlArgs['sbODID']);
            var PRODUCTID = parseInt(urlArgs['sbproductid']);
            var SAPID = urlArgs['SAPID'];
            var PRODUCT = urlArgs['product'];

            var NUMUSERS = document.getElementById('numUSers').value;

            var EMAIL = document.getElementById('email').value;
            var PRICE = document.getElementById('licensePrice').value;



            var oWnd = GetRadWindow();
            var windowURL = "v8Wizard_Page3.aspx?sbODID=" + ODID + "&sbOID=" + OID + "&SAPID=" + SAPID + "&sbProduct=" + PRODUCT +
                        "&email=" + EMAIL + "&numUsers=" + NUMUSERS + "&licenseprice=" + PRICE;
            oWnd.setUrl(windowURL);

        }

        function validate() {
            if (document.getElementById('licensePrice').value == "") {
                alert("Price can not be blank");
                return false;
            }
            if (document.getElementById('numUsers').value == "") {
                alert("Number of users can not be blank");
                return false;
            }
            if (document.getElementById('email').value == "") {
                alert("Email  can not be blank");
                return false;
            }
            var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
            var emailid = document.getElementById('email').value;
            var matchArray = emailid.match(emailPat);
            if (matchArray == null) {
                alert("Your email address seems incorrect. Please try again.");
                return false;
            }
            return true;
        }    
        function returnToParent()
        {
             //create the argument that will be returned to the parent page
             var oArg = new Object();

             //get the name
             var numField = document.getElementById("numUsers");
             var numUsers = numField.value;
             oArg.numUsers = numUsers;
        
            //get a reference to the RadWindow
            var oWnd = GetRadWindow();
            
            //set the argument to the RadWindow
            oWnd.argument = oArg;
            //close the RadWindow            
            if(numUsers.Text != "")
            {
                oWnd.close();
            }
            else
            {
                alert("Please enter number");
            }
        }
        
        var priceBox;
        var showPrice;
        var priceFromPackageGrid;
        
        function setnewprice() {
            var oldprice = priceBox.get_value();
            var newprice = priceFromPackageGrid;
            priceBox.set_value(newprice);
            var x = 1;
        }

        function priceLoaded(sender, args) {      /* called when default package grid loads */
            priceFromPackageGrid = sender.get_value();
            if (sender.get_value != "")
                priceBox.set_value(sender.get_value());
            var x = 1;
        }
        function PriceBoxLoad(sender, args) {  /* called when the numeric textbox changes */
            priceBox = sender;
            var y = priceBox.get_value();
            var x = 1;
        }  
        
        </script>
<asp:Label  ID="title" runat="server" Font-Bold="true" Font-Names="Monotype Corsiva" Font-Size="XX-Large"></asp:Label>
   <telerik:RadFormDecorator ID="formDecorator1" runat="server" DecoratedControls="All" Skin="Office2007" />

   <table>
   <tr>
    <td>
          <asp:Label runat="server" Text="Choose a package"></asp:Label>
           <telerik:RadComboBox  
                            ID="package" Width="220px"   runat="server"   OnSelectedIndexChanged="RadComboBoxSelectedIndexChanged"
                            MarkFirstMatch="True"  AllowCustomText="True"   DataSourceID="ContentCentralPackages"   
                            EmptyMessage="Select a package" ExpandAnimation-Type="None"  DataTextField="package_name"
                            CollapseAnimation-Type="None" AutoPostBack="true" AppendDataBoundItems="false"
                            OnClientSelectedIndexChanging="setnewprice"  HighlightTemplatedItems="True"  
                            DataValueField="package_cd"   DropDownWidth="550px"  OnClientKeyPressing="setnewprice"
                            Skin="WebBlue"  EnableVirtualScrolling="True" CausesValidation="false" >
                             <ExpandAnimation Type="InOutElastic" />
                             <CollapseAnimation Duration="200" Type="InOutExpo" />
                          <HeaderTemplate>
                           <table style="width: 520px; text-align: left">
                            <tr>
                                <td style="width: 170px;">
                                    Package Name
                                </td>
                                <td style="width: 350px;" >
                                    Description
                                </td>
                                <td style="width: 0px;" >
                                    
                                </td>
                            </tr>
                          </table>
                        </HeaderTemplate>
                    <ItemTemplate>
                        <table style="width: 320px; text-align: left">
                            <tr>
                                <td style="width: 170px;" valign="top">
                                    <%# DataBinder.Eval(Container.DataItem, "package_name") %>
                                </td>
                                <td style="width: 350px;">
                                    <%# DataBinder.Eval(Container.DataItem, "descriptions") %>
                                </td>
                               
                            </tr>
                        </table>
                    </ItemTemplate>
                 </telerik:RadComboBox>  
                 Package Price:
                <telerik:RadNumericTextBox ID="inFormPkgPrice" runat="server"   
                                    Culture="English (United States)" Type="Currency"   
                                      Width="125px"   OnTextChanged="RadNumericDefaultPackageTextChanged">  
                                      <ClientEvents OnLoad="PriceBoxLoad"  />
                                  </telerik:RadNumericTextBox>
                <br />
             </td>
             
             
      
 
            <td>
         
            
                <div class="wizardcenter">
            
                <telerik:RadGrid ID="PackagePriceGrid" runat="server" AutoGenerateColumns="False" DataSourceID="spAddNewsTradeProduct"  
                                GridLines="None" Skin="Office2007"  
                              ShowStatusBar="True"  >
                  <MasterTableView CommandItemDisplay="None" EditMode="InPlace" DataKeyNames="service_id,Checked" >   
                    <Columns>
                       <telerik:GridBoundColumn  UniqueName="service_id" DataField="service_id" Visible="false" Display="false">
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="service_name" HeaderText="Default Package"  Display="true" UniqueName="service_name" >
                       </telerik:GridBoundColumn>
                       <telerik:GridTemplateColumn HeaderText="Purchased" UniqueName="CHECKED">
                        <ItemTemplate>
                          <asp:CheckBox ID="Entitled"  Checked='<%# Eval("Checked") %>' runat="server" />
                                 </ItemTemplate>
                          </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn  UniqueName="PKGPRICE" HeaderText=""  Display="false" >
                        <ItemTemplate>
                                  <telerik:RadNumericTextBox ID="PKGPRICE" runat="server"  Price='<%# Eval("Price") %>'
                                    Culture="English (United States)" Type="Currency"   DbValue='<%# DataBinder.Eval(Container.DataItem, "Price") %>'  
                                      Width="125px" >  
                                      <ClientEvents    OnLoad="priceLoaded"  OnValueChanged="priceLoaded" />
                                  </telerik:RadNumericTextBox>
                               </ItemTemplate>
                         </telerik:GridTemplateColumn>
                     </Columns>
                    
                  </MasterTableView>
                </telerik:RadGrid>
          </div>
                </td>                   
                </tr>
                </table>
                          
    
     
     <div class="wizardRight">
                
    
      <div style="height:40px;width:50px;">
       <asp:Button  ID="continueButton" runat="server"  style="width:100px;" OnClientClick="goToNextStep();" Text="Continue"
              ></asp:Button></div>
       
     </div>
    
     <div class="wizardLeft">
        <br /><br />
        back
        <br /><br />
    
      <div style="height:40px;width:50px;">
       <asp:Button  ID="backButton" runat="server"  style="width:100px;" OnClientClick="goBackOneStep();" Text="Back"
               ></asp:Button></div>

And it's corresponding C#:

public partial class v8Wizard_Page2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Page.IsPostBack == false)
        {
            title.Text = Request.QueryString["product"];
            odid.Text = Request.QueryString["sbODID"];
            productname.Text = Request.QueryString["product"];
            SAPID.Text = Request.QueryString["SAPID"];
            temptablename.Text=Request.QueryString["ttt"];

            //if this is the first time here create a temp table and fill it with default package info
            if (temptablename.Text.Length <= 0)
            {
                package_cd.Text = "NTB";

                string strMyGuid = System.Guid.NewGuid().ToString();
                string tempTable = "temp_" + strMyGuid;
                string sTempTable = tempTable.Replace("-", "");
                temptablename.Text = sTempTable;
                Create_Temp_Table(sTempTable);
            }
        }
    }
    protected void Create_Temp_Table(string tableName)
    {

        // Create Instance of Connection and Command Object
        SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ContentCentralConnectionString"].ConnectionString);

        SqlCommand myCommand = new SqlCommand("isp_sbAddNewsTradeProduct", myConnection);

        // Mark the Command as a SPROC
        myCommand.CommandType = CommandType.StoredProcedure;

        // Add Parameters to SPROC
        SqlParameter parameterTableName = new SqlParameter("@temptablename", SqlDbType.NVarChar, 200);
        parameterTableName.Value = tableName;
        myCommand.Parameters.Add(parameterTableName);

        try
        {
            myConnection.Open();
            myCommand.ExecuteNonQuery();
            myConnection.Close();
        }
        catch (Exception e)
        {
            int x = 1;
        }
    }
    protected void RadNumericDefaultPackageTextChanged(object sender, EventArgs e)
    {

        //Have to get stored procedure from Tom to save the price to the database
        RadNumericTextBox ntb = (RadNumericTextBox)sender;
        RadNumericTextBoxPrice.Value = ntb.Value;

    }
    protected void RadComboBoxSelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        string sCurrentPackage = e.Value.ToString();
        package_cd.Text = sCurrentPackage;
        
    }
}

                
               





1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 03 Nov 2008, 03:16 PM
Hi Laura,

I examined your code and it seems to be correct. At this point I suggest to implement your scenario with a standard IFRAME element instead of RadWindow. When you succeed to get the desired behavior with the standard IFRAME, please open a new support ticket and send me the solution with the standard IFRAME. Once I receive it, I will modify it to use our RadWindow control instead of the IFRAME.

Regards,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Laura
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or