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,
I have a hierachical table with child tables. I wanted to refresh my child table but couldn't manage to do so.
I've looked at some of the community posts and tried to refresh my child table via a script
grid.Tables["MyChildTable"].Refresh(); // Using DataMember name} and IN ASPprotected void Button1_Click(object sender, EventArgs e) { WebGrid1.ClientAction.InvokeScript("refreshChild();"); } This doesn't work. I then tried <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" OnClientClick="refreshChild()" /> With the OnClientClick and the refreshChild() function is invoked (i had put alert boxes there to tell me). However the child table still does not refresh. Only until i restart my web server that the child table data (new data) is reflected correctly. Logging out or closing browser doesn't help. I've set HierarchicalMode="LoadOnDemand" but does not make a difference. Would appreciate if someone can point me in the right direction. Best Regards, Larry
}
and IN ASP
{
WebGrid1.ClientAction.InvokeScript("refreshChild();"); } This doesn't work. I then tried <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" OnClientClick="refreshChild()" /> With the OnClientClick and the refreshChild() function is invoked (i had put alert boxes there to tell me). However the child table still does not refresh. Only until i restart my web server that the child table data (new data) is reflected correctly. Logging out or closing browser doesn't help. I've set HierarchicalMode="LoadOnDemand" but does not make a difference. Would appreciate if someone can point me in the right direction. Best Regards, Larry
This doesn't work.
I then tried <
With the OnClientClick and the refreshChild() function is invoked (i had put alert boxes there to tell me). However the child table still does not refresh. Only until i restart my web server that the child table data (new data) is reflected correctly. Logging out or closing browser doesn't help. I've set HierarchicalMode="LoadOnDemand" but does not make a difference. Would appreciate if someone can point me in the right direction. Best Regards, Larry
Best Regards,
Hello Larry,
To refresh child table, you simply need to use the following script:
function refreshChild() { var grid = ISGetObject("WebGrid1"); grid.Tables["Orders"].Refresh(); }
I have attached a sample file for your reference. In the sample, I used hierarchical grid with table Orders and Order Details as its child tables. By using the code above, I simply refresh the child table with named "Orders".
Hope this helps.
Thank you.
Hi Martin,
thanks for your reply. This was what I have tried during in the description of my first post. The refresh action did happen, but the child table data did not reflect any different.
Refreshing the page by browser (F5) key however does it, but this is not what I wanted. I've also tried the server side refresh, but it didn't work either though the postback did happen.
Regards,
Larry
I’d like to add information that hopefully usefull for your specific scenario.
In order to refresh child table using JavaScript function, please refer to Martin’s post. Should you need to invoke the JavaScript function from an ASP.NET Button click event, please try to use following approach.
Add an ASP.NET Button that will be used to refresh the child table of WebGrid.
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Refresh Child Table" />
Add a WebFlyPostBackManager, set the ServiceUrl property to the url of your page and enable the UI mode. The WebFlyPostBackManager code will look like below.
<ISWebDesktop:WebFlyPostBackManager ID="WebFlyPostBackManager1" runat="server" ServiceUrl="~/UnderTest/RefreshChildTableData.aspx" EnableUIMode="true"> <FlyPostBackSettings PostViewState="true" /> </ISWebDesktop:WebFlyPostBackManager>
In Page_Load event, create an instance of WebFlyPostBackListener.
protected void Page_Load(object sender, EventArgs e) { WebFlyPostBackListener listener = new WebFlyPostBackListener(this.Page); }
In the Button1_Click event handler, add following code in order to invoke the “refreshChild” JavaScript function.
protected void Button1_Click(object sender, EventArgs e) { WebFlyPostBackManager1.ClientAction.InvokeScript("button2_onclick();"); }
The refresh of the child table is indicated by the appearance of “Refreshing child table…” text in the status bar of WebGrid.
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