We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid in Update Panel

Thread ID:

Created:

Updated:

Platform:

Replies:

132065 Aug 10,2017 05:45 PM UTC Aug 22,2017 01:31 PM UTC ASP.NET Web Forms 7
loading
Tags: Grid
Luis Fernando
Asked On August 10, 2017 05:45 PM UTC

Hello
I have a project with two web pages form: page1, page2. On both pages I have a grid inside an update panel.
Suppose I opened page1 and then page2 on another browser tab. When I return to page1 and click on a button to update the update panel, the grid records of page2 are displayed in the grid.
How to solve this?

Thank you.

Prasanna Kumar Viswanathan [Syncfusion]
Replied On August 11, 2017 12:50 PM UTC

Hi Fernando, 

Thanks for contacting Syncfusion support. 

We checked in our sample with two web pages and in both pages we placed a Grid inside an updated Panel. Once we opened the two web pages in two browser tabs and you have mentioned that when you return to Page 1 and click on a button to update the update panel, the grid records of Page 2 are displayed in the grid. Here we need a detail description regarding updating the update panel.  
 
We checked with by updating the records in the Grid and we unable to reproduce the mentioned issue at our end. So, we need the following details.  
 
1. Share the code example.  
  
2. Share the video demonstration of an issue.  
 
3. Essential Studio Version details.  

4. If possible, replicate the issue in the attached sample.  


Regards, 
Prasanna Kumar N.S.V 
 


Luis Fernando
Replied On August 11, 2017 07:50 PM UTC

Follow the example.


1 - Open Page1 and then Page2 on another browser tab.

2 - Return to Page1 and click in the Update button. The grid records of Page2  are displayed in the grid.


Attachment: WebSite4_94016f7b.zip

Vignesh Natarajan [Syncfusion]
Replied On August 14, 2017 01:13 PM UTC

Hi Fernando, 

Thanks for contacting Syncfusion support. 

We have analyzed your sample and we are able to reproduce the issue at our end. The reported issue is occurred due to both the Grid has same ID and dataSource is updated based on the Grid ID.  

Page1.aspx  
private void BindDataSource() 
    { 
        int orderId = 10643; 
        int empId = 0; 
                . 
                . 
                . 
        this.OrdersGrid.DataSource = order; 
        this.OrdersGrid.DataBind(); 
    } 


Page2.aspx 
private void BindDataSource() 
    { 
        int orderId = 10643; 
        int empId = 0; 
                . 
                . 
                . 
        this.OrdersGrid.DataSource = order; 
        this.OrdersGrid.DataBind(); 
    } 


Both the Grid have same ID and whenever the page is refreshed the dataSource will be changed(if it doesn’t match with current dataSource).  
To overcome/neglect this issue, use different ID for different Grid. 
We have modified your sample page2.aspx and page2.aspx.cs file so that issue can be resolved. the modification we made ere explained in code snippet and the sample can be downloaded for the following link 
Page2.aspx 
<ej:Button ID="Button1" runat="server" Type="Button" OnClick="Button1_Click" Text="Update"></ej:Button> 
          <ej:Grid ID="OrdersGrid1" runat="server" DataSourceCachingMode="Session" AllowPaging="True"> 
      
Page2.aspx.cs 
 
        this.OrdersGrid1.DataSource = order; 
        this.OrdersGrid1.DataBind(); 
    } 



Regards, 
Vignesh Natarajan 


Luis Fernando
Replied On August 17, 2017 07:33 PM UTC

Thank you, Vignesh.


Are there any other alternatives besides this? Because as pages are standardized I would keep the grid on the master page and on the child pages I would load it.


Saravanan Arunachalam [Syncfusion]
Replied On August 18, 2017 10:37 AM UTC

Hi Luis, 
We have analyzed your query, the cause of the issue is that the page2 tab became active when open the page2 in new browser tab and updated the update panel with details in active tab. 
So, we suggest you to set the different id either for the Grid or UpdatePanel to overcome your issue and hence could you please provide the following details? 
1.       Do you want to render the reusable Grid? 
2.       Do you expect bind the different data to the Grid dynamically? 
3.       Why you placed grid in master page? 
4.       Provide clear details about your requirement. 
Regards, 
Saravanan A. 


Luis Fernando
Replied On August 21, 2017 11:34 AM UTC

Yes, I want to render the reusable Grid and I expect bind different data to the Grid dynamically.

I placed grid in master page because all the pages will follow the same pattern, I will have a registration form and as I add new records, edit or delete existing records, I reload the grid.


Saravanan Arunachalam [Syncfusion]
Replied On August 22, 2017 01:31 PM UTC

Hi Luis, 
Based on your requirement, we have created Asp.Net user control to render the reusable grid control on the page and we have modifed the previously provided sample with user control that can be download from the below link. 
Note: If we render the user control within the update panel, we need to manually update User control with updated data because the UpdatePanel.Update() method will reset the user control with initial data. 
Regards, 
Saravanan A. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;