iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
This is a new Issue which we are having after the Grid update recently.
I have my first page(page1) with selfreferencing grid load on demand set to true.The Grid is having setting DataCacheStorage="session".This grid is having a column of type columType="ButtonImage" and the below server code
Protected Sub grid_ButtonClick(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.ButtonEventArgs) Dim _checkedRowKey As String = grid.SelectedRowKeyValue Dim ds1 As DataTable = CType(grid.DataSource, DataTable) Dim drv As DataRow() = ds1.Select("id = '" + _checkedRowKey + "'") end sub
We are binding the grid using the Initialize datasource event as below .
Protected Sub grd_InitializeDataSource(ByVal sender As Object, _ Dim _cours As New myobject _cours.GetMyParentRecords(1, sid, Session(gs_USERSTATE).UserID, -1, False) grd.ClearCachedDataSource() ' added this code to clear cache,BUG still exists without this code e.DataSource = _cours.DefaultView.Table end sub
This grid on this page(page1) shows the records which I add through another page(page2).
Steps to recreate the actual issue .
1.Go to page1 to view the records.It displayes the record
2. Go to page2 to Add more records and add more records.
3.Go to Page1 to view the added records.The newly added records is shown correctly
4.Now click on the Image button column of the newly added record.
put a break point in the above button click event code.The value of grid.SelectedRowKey is showing correctly.Now the datarow 'drv' row count will be zero.It fails to find the selected record.
The BUG here is grid.datasource is still having the old record count.the count before adding the records through page page2.
Why the grid fails to find new records in the button click code even though the records are visible and the selectedRowKey values are correct?
THIS IS A NEW BUG HAPPENING AFTER THE NEW GRID UPDATE.WE HAD HIS CODE USED SINCE 1 YEAR WITHOUT ANY ISSUE.
Please find a solution for this ASAP.This is straight forward to reproduce.
Thanks
Arun
Arun,
With the setting turned off, the data caching will still work in subsequent postback and FlyPostBack requests. However, the data cache will be invalidated on first page load (non postback condition).
Looking at your scenario, I'd suggest you to set the AlwaysUseCachedDataOnFirstLoad property to false to ensure your data is fresh upon first load.
The GetCachedDataSource is the correct method to get cached data, and not .DataSource property.
Hi Arun,
I will need to replicate your issue in here. Is it possible for you to help me replicate it in simple sample/scenario?
Besides that, i also need to know the following details below:
Step2, what did you use to add new records?
Step3, how you view the added records (such as refresh and etc)?
Regards,Handy
HI,
Answer to your question .
1. In Step2 I add records through a storedprocedure.
2.In step3,I view the added records by going directly into page1.In page1 the data bind is done in InitializeDataSource as specified in my first mail.there is no call to refresh.
this is really something to do with session and cached data because if I logout(i clear all session here) from my software and login again and goes to page1.the data is displayed correctly and button click event works fine with correct record count.
Aiyer,
Firstly, make sure that the always load cache on page load setting is set to false. The setting can be accessed in grid.LayoutSettings.AlwaysUseCachedDataOnFirstLoad.
Then, you should use grid.GetCachedDataSource() method in order to get the cached data source instead of .DataSource and cast it to appropriate datasource type.
Let me know if that helps.
- James.
Hi James,
This won't work.If you set AlwaysUseCachedDataOnFirstLoad="False" ,how will the grid cache the data.Then GetCachedDataSource will be nothing then.
Any other solution?
Intersoft support help us to resolve this without a sample application....
Thanks for the update James.Still I am having the issue with this settings.
If it's easy enough for you to reproduce the issue in a simple sample, you can zip the sample project along with required sample database and files in the attachment. I'll help you take a look and give a quick shot on it.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname