User Profile & Activity

Gordon Tumewu Support
Page
of 19
Posted: August 24, 2009 11:54 PM

Hi,

I have discussed this with our development team they said that it's not possible because WebGrid is naturally designed as an component instance, so each AJAX request should also follow the same discipline. Otherwise, how can the server-side knows which WebGrid is performing refresh (if all requests are combined).

Best Regards,

Gordon Tumewu

Posted: August 24, 2009 11:24 PM

Hi Koby,

Could you describe more spesific about the issue? What structure that you lost? Also step to reproduce the issue.

Thanks.

Best Regards,

Gordon Tumewu

Posted: August 24, 2009 11:03 PM

Hi Vincenzo,

I have tried to create a simple sample, but didn't manage to get the same issue as yours. In my end the OnBeginRowEditing is triggered everytime I enter the new row. This is my grid's settings:

<LayoutSettings AllowAddNew="Yes" AllowEdit="Yes">
                <ClientSideEvents OnBeginRowEditing="OnBeginRowEditing" />
            </LayoutSettings>

Also could you try to put debugger at the event to check whether the event triggered or not.

Best Regards,

Gordon Tumewu

Posted: August 21, 2009 6:18 AM

@Gordon:- Concider the fact that i have 5 webgrids in my webpage and the user is updating each 5 webgrids. And am doing the save in a single click. But to reflect changes of these webgrids, i have to call the refresh method of these 5 webgrids. Means 5 asynchronous postbacks. That means heavy load. Is there any alternative?

Actually it depends on your scenario.

1. If you edit using inline editing at WebGrid then you didn't need to refresh the grid, because the grid allready get the changes that you do.

2. You can use our batch update, the user can modify the data at 5 WebGrid that you have and use button click to get all the changes and modify in database. You didn't need to refresh the grid.

3. If you update the data directly in database, then definetely you need to refresh the grid because WebGrid didn't know which changes has been made in the database without refreshing it.

Posted: August 21, 2009 6:04 AM

Hi Yaniv,

Actually in WebGrid 7 we have new feature that enable the user to customize some style but still have default style for the rest of style.  You need to set LayoutSettings >> AllowDefaultStyleMerging property to true. So you can still change the alignment and have default style.

Also you can check the other post that related with AllowDefaultStyleMerging property in http://www.intersoftpt.com/Community/WebGrid/HeaderStyle/.

Hope this helps.

Best Regards,

Gordon Tumewu

Posted: August 21, 2009 5:56 AM

Hi John,

Usually the issue happend because the control didn't get the the resources like ScriptDirectory and SharedScriptDirectory, etc. Do you used SmartWebResources? If yes, you need to make sure that ISNet.WebUI.Resources.dll and other resources dll(e.g ISNet.WebUI.WebGrid.Resources.dll) is updated using the latest version. But if you are not using SmartWebResources, please make sure that the CommonLibrary folder inside your project is updated using the latest script that comes with the hotfix.

One more thing, if you turn on the cookies in IE, did the problem also occured?

Best Regards,

Gordon Tumewu

Posted: August 21, 2009 5:42 AM

Infact only Webgrid1.ClientAction.Refresh() is required. First you need to check if this event is working or not. If the refresh is working then page will load once again asynchronously and go through the webgrid initialise event once again and rebinding takes place. If you are getting a postback then you try James's method. And if you are using Webgrid1.ClientAction.Refresh() or WebGrid1.ClientAction.RefreshAll() then you dont need to apply neither WebGrid1.ClearCachedDataSource() nor WebGrid1.RebindDataSource().

Anyway check if the refresh is causing asynchronous postback. And are you using Initialisedatasource event of webgrid?

It's true, everytime you do WebGrid1.ClientAction.Refresh() then the grid will called the InitializeDataSource event. The important thing is you always need to put your binding method inside InitializeDataSource event, therefore everytime you do Refresh() the InitializeDataSource event triggered.

One more thing RefreshAll used to refresh the data and structure of the grid, if you only need to get the changes in data then you only need to have Refresh()

Anyway check if the refresh is causing asynchronous postback. And are you using Initialisedatasource event of webgrid?

It's true, everytime you do WebGrid1.ClientAction.Refresh() then the grid will called the InitializeDataSource event. The important thing is you always need to put your binding method inside InitializeDataSource event, therefore everytime you do Refresh() the InitializeDataSource event triggered.

One more thing RefreshAll used to refresh the data and structure of the grid, if you only need to get the changes in data then you only need to have Refresh()

Posted: August 21, 2009 5:18 AM

Hi,

It's true, WebGrid can use global culture but our development team said that it's not best practice to use the global variable. But great to hear that the rewritten process solve the issue.

Best Regards,

Gordon Tumewu

Posted: August 21, 2009 4:27 AM

Hi,

It is because "en" is a global culture, and our products require a specific locale, not a global one. Because global culture is too general and may not be accurate. For example culture in en-UK and en-US is very different.

That's why you need to use the spesific culture. Hope this helps.

Best Regards,

Gordon Tumewu

Posted: August 21, 2009 3:19 AM

Hi Mark,

I am really sorry but the following article only for WebGrid 6 and below. For WebGrid 7 we have enhance the feature so you can set the height or other style but still have the default style.

This is the code behind for InitializeLayout event:

protected void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
    {
        e.Layout.HeaderStyle.Height = 40; // You can change the height according to your scenario
        e.Layout.AllowDefaultStyleMerging = true;
    }

Hope this helps.

Best Regards,

Gordon Tumewu

All times are GMT -5. The time now is 6:40 AM.
Previous Next