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

Radwindow onClientClose

11 Answers 279 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kishor
Top achievements
Rank 2
Kishor asked on 07 Feb 2013, 07:11 AM
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.

11 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Feb 2013, 03:22 PM
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.
0
Kishor
Top achievements
Rank 2
answered on 11 Feb 2013, 09:11 AM
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

0
Accepted
Princy
Top achievements
Rank 2
answered on 11 Feb 2013, 10:41 AM
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.
0
Kishor
Top achievements
Rank 2
answered on 11 Feb 2013, 12:35 PM
Thanks a lot
it also works for me
0
Kishor
Top achievements
Rank 2
answered on 12 Feb 2013, 08:33 AM
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()
0
Kishor
Top achievements
Rank 2
answered on 12 Feb 2013, 09:40 AM
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
0
Marin Bratanov
Telerik team
answered on 13 Feb 2013, 02:42 PM
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.
0
Kishor
Top achievements
Rank 2
answered on 18 Feb 2013, 04:41 AM

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 

0
Princy
Top achievements
Rank 2
answered on 18 Feb 2013, 11:06 AM
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
0
Kishor
Top achievements
Rank 2
answered on 20 Feb 2013, 03:47 AM
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
0
Kishor
Top achievements
Rank 2
answered on 01 Mar 2013, 05:51 AM
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
Tags
Window
Asked by
Kishor
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Kishor
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or