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

Rad Grid row expand under ASP:UpdatePanel after postback

3 Answers 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
chirag
Top achievements
Rank 1
chirag asked on 04 Jan 2016, 05:26 PM

Hi Team,

I am using Rad Grid in my project. I want to expand row template on click of row from client side. The code runs fine but when I put ASP .Net Update panel, code stops running after page postback. Below is my code. I am implementing this under DNN site.

 

Update panel code:

<asp:UpdatePanel ID="updOnlinePaymentHistory" runat="server">
        <ContentTemplate>

               ..........

</ContentTemplate>
    </asp:UpdatePanel>

 javascript function:

function RowClick(sender, args) {
              var item = args.get_item();
              var lastState = item.get_expanded();
              var Grid = $find("<%= gridPayment.ClientID %>");
              var MasterTable = Grid.get_masterTableView();
              for (var i = 0; i < MasterTable.get_dataItems().length; i++) {
                var row = MasterTable.get_dataItems()[i];
                row.set_expanded(false);
              }
              item.set_expanded(!lastState);

        }

 

HTML defining Rad Grid:

<telerik:RadGrid ID="gridPayment" 
                                AllowPaging="true" 
                                PageSize="24" 
                                runat="server" 
                                AllowSorting="true" 
                                CellSpacing="0" 
                                GridLines="Horizontal" 
                                CssClass="table-responsive"
                                OnItemDataBound="grdPayment_ItemDataBound" 
                                OnPageIndexChanged="gridPayment_PageIndexChanged" 
                                EnableGroupsExpandAll="false" 
                                RegisterWithScriptManager="False">

 

                                   <!-- column and template code here -->

 

                                 <ClientSettings>
                                    <ClientEvents OnRowClick="RowClick" />
                                </ClientSettings>

                     </telerik:RadGrid>

 

When I load page, row expand works fine. but after postback of page, it stops working.

 

Can you please help me out on this.

 

Chirag Khunti

 

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 07 Jan 2016, 09:47 AM
Hello Chirag,

Can you please wrap the script in RadScriptBlock control and see how it goes? Also try to replace the asp UpdatePanel with Telerik RadAjaxPanel and see if this makes any difference.

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
chirag
Top achievements
Rank 1
answered on 07 Jan 2016, 10:13 AM

Hey Maria,

Thanks for your reply. I resolve it by giving RegisterWithScriptManager="true" as Telerik property. it's working as expected now.

 Thanks for your time.

Regards,

Chirag Khunti

0
Maria Ilieva
Telerik team
answered on 11 Jan 2016, 12:24 PM
Hello,

I'm glad that you were able to fix the issue on your end. Do not hesitate to contact us back in case further assistance is needed.

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
chirag
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
chirag
Top achievements
Rank 1
Share this question
or