Radwindow onClientClose

12 posts, 1 answers
  1. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 07 Feb 2013 Link to this post

    Hello,

    I have a grid in which there is radio button.When user clicks on radio button ,radwindow is opened, now i wanted to close the window using top red cross button but after closing my radio button looses check/ uncheck value.For this
    I wrote onClientClose() for radwindow
    In my parent page, code is like this

     function OnClientClose(sender,args)
                {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }

    In my radwindow there is one save button and one cancel button.In both the buttons i am calling closeandrebind()
    But after clicking those buttons , my parent page is loading again which i don't want to happen.
    When i debug it, i found it was happening because of OnClientClose

    Please help me with this problem.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 07 Feb 2013 Link to this post

    Hi Kishor,

    It seems the RadAjaxManager updates the RadGrid in the request. This is the reason why the state of the radio button is lost (the element is disposed) and this is why part of your pages refreshes. If you only want to rebind the grid when the [x] button is used you can pass some arguments from your buttons' handlers. Then, if an argument is present you will not call the ajaxRequest(). If the [x] button is used there will be no arguments. How to pass and obtain these arguments is shown in this demo.


    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. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 11 Feb 2013 Link to this post

    Resp sir
     
     i have problem which is as follow
         
          on button_ click()         
    'I have called SaveCustomer function()
              {
                  Call SaveCustomer()
              }
                            
             protected sub SaveCustomer()    ' In SaveCustomer fun SendMail fun is called
              {        
                  Call SendMail()    
               }
          
            Protected sub  SendMail()     
             {
               RadWindowManager1.RadAlert(" Password send to contact person.", 330, 100, " confirmation", "")
             }    
      this Radwindow does not get displayed.
      please help me to solve this problem.
     
    thanks in advance
    Kishor

  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Feb 2013 Link to this post

    Hi Kishore,

    Unfortunately I was not able to replicate the issue. Here is the code I tried which works fine for me.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" Text="Click Me" OnClick="RadButton1_Click">
    </telerik:RadButton>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Windows7">
        <Windows>
            <telerik:RadWindow ID="radWindow1" runat="server">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        SaveCustomer();
    }
    protected void SaveCustomer()
    {
        SendMail();
    }
    protected void SendMail()
    {
        RadWindowManager1.RadAlert(" Password send to contact person.", 330, 100, " confirmation", "");
    }

    Thanks,
    Princy.
  6. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 11 Feb 2013 Link to this post

    Thanks a lot
    it also works for me
  7. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 12 Feb 2013 Link to this post

    hello 

        my problem is as follows
       
      I have saveCustomer() function. In this function I have called  sendemailtoContactPerson( ) and Immediately called a script 
      CloseAndRebind() to close the Radwindow().
     The RadAlert  which is present in sendemailtoContactPerson() does not get displayed. 
      please help me to solve this problem.
      
     
         Protected Sub SaveCustomer()
                Call sendemailtoContactPerson( )
               System.Web.UI.ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "Script", "CloseAndRebind();", True)
          End Sub


        Protected Sub sendemailtoContactPerson()
                     RadwindowManeger1.RadAlert("Password send to contact person.", 330, 100, "Password confirmation", "")
        End Sub


     "CloseAndRebind() script is used to close Radwindow after mail is send.
      save button is present on Radwindow. on save button clicked i have called SaveCustomer()
  8. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 12 Feb 2013 Link to this post

    Hello

       When I click Refresh Button of RadGrid which is in Contenttemplate I get Runtime Error as

      
                Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the                     server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(),
                 response filters, HttpModules, or server trace is enabled.
                 Details: Error parsing near '"postBack":0,"value"'.

    It gives error only in IE verson 8.0 and not in other browsers
    please guide me why this happens

    Thanks
  9. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 13 Feb 2013 Link to this post

    Hello,

    This problem is most likely due to a server error trapped by MS AJAX - it changes the response and thus it cannot be parsed on the client - it is not what the framework expects. You should debug your code to see if this is the case. You should also check the exact response and what is wrong with it. This can be done in the dev toolbar or with tools like Fiddler.

    Another possible reason is having DestroyOnClose set to true - the iframe will be disposed as soon as close() is called but there are still scripts to be executed to show the RadAlert. In this case it is better to close the RadWIndow in the callback function of the RadAlert.

    On a side note - I advise that you open a new thread for new and unrelated issues you have, because this makes it more concise and the person who is trying to help you will not need to review tons of irrelevant information each time.


    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.
  10. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 17 Feb 2013 Link to this post

    Hello 
    How to format date column while exporting data to excel
    because when i export RadGrid to excel the values of date column looks like this  
    $41,304.58 
    please help me
    thanks
    Kishor







    $41,304.58 

    $41,304.58 

  11. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Feb 2013 Link to this post

    Hi Sawan

    Try the following markup and code snippet to format date column while exporting data to Excel.
    aspx:
    <telerik:RadGrid ID="RadGrid1" runat="server"  OnExcelExportCellFormatting="RadGrid1_ExcelExportCellFormatting"
    ...............................
    >
     <ExportSettings  Excel-Format="ExcelML" />
    </telerik:RadGrid>
    C#:
    protected void RadGrid1_ExcelExportCellFormatting1(object sender,Telerik.Web.UI.ExcelExportCellFormattingEventArgs e)
     {
      if (e.FormattedColumn.UniqueName == "BirthDate")
        {
          e.Cell.Style["mso-number-format"] = @"mmm\_dd\,\_yyyy";
        }
     }

    Thanks
    Princy
  12. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 19 Feb 2013 Link to this post

    Hello

    In Radgrid I have inserted record which contains <br> and &nbsp; (ie newline and space)
    when grid is loaded record is displayed without <br> and &nbsp; 
    But when i export Radgrid to Excel  record is exported with <br> and &nbsp;(ie record in excel sheet contains <br> and &nbsp;

    while exporting i dont <br> and &nbsp; to be exported
    so please help me to solve this problem

    Thanks
    Kishor
  13. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 28 Feb 2013 Link to this post

    Hello

    In Radgrid I have inserted record which contains <br> and &nbsp; (ie newline and space)
    when grid is loaded record is displayed without <br> and &nbsp; 
    But when i export Radgrid to Excel  record is exported with <br> and &nbsp;(ie record in excel sheet contains <br> and &nbsp;

    while exporting i dont <br> and &nbsp; to be exported
    so please help me to solve this problem

    Thanks
    Kishor
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017