Rad window problem--by using javascript.

4 posts, 0 answers
  1. Rama
    Rama avatar
    22 posts
    Member since:
    Jun 2012

    Posted 25 Feb 2013 Link to this post

    Hello Team,

    I am using a rad window to update the content in my grid, I got a sample from telerik forums and I am using it. It did worked fine for me.

    I used java script to open the rad window from the code base rad grid item created.

    this is in .aspx page :

        function RefreshrgUnitTypesGrid() {

            var masterTable = $find("<%= rgunitTypes.ClientID %>").get_masterTableView();
            masterTable.rebind();

        }




        function ShowEditFormrgTypes(id, rowIndex) {


            var gridunitTypes = $find("<%= rgunitTypes.ClientID %>");

            var rowControl = gridunitTypes.get_masterTableView().get_dataItems()[rowIndex].get_element();
            gridunitTypes.get_masterTableView().selectItem(rowControl, true);

            window.radopen("../ERP/NormalPages/AddUnitTypes.aspx?ID=" + id, "UserEditUnittype");

            return false;
        }


     this is in item created:

        ImageButton imgBtnEditTenancy = (ImageButton)e.Item.FindControl("imgBtnEditTenancy");
                        imgBtnEditTenancy.Attributes["onclick"] = String.Format("return ShowEditFormrgTypes('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"], e.Item.ItemIndex);

    and here is my window:

         <telerik:RadWindow ID="UserEditUnittype" runat="server" Title="Edit Unit Type" Height="320px"
                    Width="310px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                    Modal="true"  onclientclose="RefreshrgUnitTypesGrid">
                </telerik:RadWindow>



    ----- problem is , I am able to see a rad window ,but not this "UserEditUnittype" where I mentioned height ,width and title. One rad window is popping up where I was surprised see that which don not all the properties that I mentioned. I am attaching a screen shot. can some one please look into that issue for me?


  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 25 Feb 2013 Link to this post

    Hi Rama,

    The most likely reason for this behavior is the presence of several RadWindowManagers on your page, so radopen() is not using the one you expect. The following help article treats this case and offers solutions: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-wrong-window-opened.html.


    All the best,
    Marin Bratanov
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rama
    Rama avatar
    22 posts
    Member since:
    Jun 2012

    Posted 26 Feb 2013 Link to this post

    Hello Marin Bratanov ,

    Thanks for your response and I understood the problem. From that help article I got to know there seems to be a problem with the rad window manager. My current scenario is that, I am using four user controls on the same page and each individual user control got the same functionality as "results in grid view, edit and delete options by using the rad windows", I have four rad window managers in four user controls. This might be the reason for that.

    I tried use that script from that help article like as follows,


        function ShowEditFormforUnit(id, propertyId, rowIndex) {
           var oWnd = $find("<%=UserListDialogforUnit.ClientID%>");
           oWnd.setUrl('../ERP/NormalPages/AddUnitConfiguration.aspx?VentureID=' + id + '&Builder=Builder' + '&PropertyUnitId=' + propertyId);
            oWnd.show();
           
        }


    but this script is throwing an exception stating there is an  Invalid postback or callback argument. I am not sure how this script help me. Can you help on this?

    Thanks
    Rama
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 26 Feb 2013 Link to this post

    Hi Rama,

    This function does not perform a postback, which means the origin of the validation error is somewhere else in your code. What I can suggest is making sure that the button that is used to call it does not perform a postback at all. Usually this is done by adding a return false; statement for the OnClientClick handler of the control.

    I would also like to note that the original issue is not a problem with the control, but a direct consequence of the comfortable way radopen, radalert, radconfirm and radprompt can be used directly, just like the browser dialogs can.

    On using the same JavaScript function on several user controls I would advise that you take a look at this thread to avoid mixing functionality between the instances: http://www.telerik.com/support/kb/aspnet-ajax/general/using-dynamic-unique-names-for-javascript-functions.aspx.


    Greetings,
    Marin Bratanov
    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