Programmatic Grid Reload

9 replies. Last post: November 4, 2010 10:10 PM by Yudi
Tags :

To Whom it may concern


I have a grid that has a set of columnsets. On a webtoolbar click the grid is being reloaded. I have managed to get the datasource to be refreshed but the columnsets are not being refreshed. Does anyone have any examples of this type of functionallity in the grids. As a extra note, the data is unbound and the columns are build programmaticall, same as the columns.


Thanks


Daniel

Answers

Yudi Member

I followed carefully the step-by-step in your previous post and was unable to reproduce the issue on my local test as shown in the attached video file.

I uses WebGrid 7.0 build 405 (7.0.7200.405), WebDesktop 3.0 build 312 (3.0.7200.312), and WebUI.NET Framework 3.0 build 756 (3.0.5000.756). These builds are available in Intersoft WebUI Studio 2010 R1 installer file.

Could you please let us know the build version of your WebGrid, WebDesktop and WebUI.NET Framework?

Thank you.

All Replies

Yudi Member

I need to know the way you specify the unbound data in order to find the possible way to refresh the column set structure. So we would need you to elaborate on your specific scenario and possibly give us a running simple sample that shows the way the data being specified.

Please let us know your response.

Due to this being part of a much larger system. I cannot find a good way of decoupling this page from the system without problems. I have included screen shots and a file with our code structure.


Regards

Daniel

1 attachment
Yudi Member

Sorry for the late response.

Below is my opinion after check the code in your sent page.

When “Reload” button is clicked, it will invokes SendCustomRequest() method of WebGrid. The SendCustomRequest basically sends a custom request to the server.

On the server side, check if the Postback action (in InitializePostBack server-side event) is invoked by the custom request. If yes (in this case is invoked by clicking the “Reload” button), refresh WebGrid data and recreate the structure of WebGrid.

I’d like suggest you to add following three lines of code into the Select Case “Reload”.

grdStockOnHand.ClearCachedDataSource()
grdStockOnHand.RebindDataSource()
grdStockOnHand.ClientAction.Refresh()

The code above will clears the cached data source, RebindDataSource will automatically reinvoke InitiliazeDataSource event and PrepareDataBinding event (where you put the method to create the structure and the column set of your WebGrid). Next, refresh the grid.

Please try to test this modification on your local end and let us know whether it helps or not.

Hi Yudi


The Reload Button does fire off a Custom paost back that is used in the InitialzePostback method, but before this the following happens:

Page Load is fired and in this the grid is checked to see if it is Flypostback and clears the datasource and rebinds the grid. it then calls the initdatasource method and then the prepare databinding. After all this is calls the init postback.


I have attempted your suggestion, but it is just forcing it to go down the same code path again.  all the data is correct and working, what im looking for is for the grid to be rerendered with the new column structure.


Thanks


Daniel

Yudi Member

I need to have a running simple sample that reproduces the issue in order to observe the problematic behavior.

I made a simple sample based on the sample code you sent on your previous post. Could you please check my sample and let us know whether the sample able to reproduce the issue or not?

You may make any changes to the sample and send the sample back to us includes the step-by-step that we can use to investigate the issue better.

1 attachment

Hi Yudi


I have imported your sample file into our system and it does replicate the issue. At load all is good, then select level product, and hit reload, and then the issue. have attached a screen shot. The only changes i made was to add a designer class as we use a web application and not a website. 


Regards


Daniel

Yudi Member

I followed carefully the step-by-step in your previous post and was unable to reproduce the issue on my local test as shown in the attached video file.

I uses WebGrid 7.0 build 405 (7.0.7200.405), WebDesktop 3.0 build 312 (3.0.7200.312), and WebUI.NET Framework 3.0 build 756 (3.0.5000.756). These builds are available in Intersoft WebUI Studio 2010 R1 installer file.

Could you please let us know the build version of your WebGrid, WebDesktop and WebUI.NET Framework?

Thank you.

Hi Yudi

We are currently using webgrid 5.0.7200.18, WebDesktop 2.0.2007.15, WebUI.NET 3.0.5000.1

I cannot seem to find your video. I am getting a 404 not found at its current location.


Hope this helps.


Regards

Daniel


Yudi Member

I apologize for any inconvenience this problem may have caused you. I have fixed and re-attached the video link in my previous post.

I’m afraid that WebGrid 5 has now been discontinued for several years and there are not going to be any further updates for it. Intersoft has enhanced and improved the column set refresh in WebGrid 7 as shown in the video of my previous post.

All times are GMT -5. The time now is 4:52 AM.
Previous Next