﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Refresh Child table data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Child-table-data/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Refresh Child table data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Child-table-data/</link><pubDate>Wed, 02 Mar 2011 14:52:13 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I’d like to add information that hopefully usefull for your specific scenario.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;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.&lt;/span&gt;&lt;/p&gt;
&lt;ol style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Add an ASP.NET Button that will be used to refresh the child table of WebGrid.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&amp;lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Refresh Child Table" /&amp;gt;&lt;/pre&gt;
&lt;ol style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt" start="2"&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;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.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&amp;lt;ISWebDesktop:WebFlyPostBackManager ID="WebFlyPostBackManager1" runat="server" ServiceUrl="~/UnderTest/RefreshChildTableData.aspx"
    EnableUIMode="true"&amp;gt;
    &amp;lt;FlyPostBackSettings PostViewState="true" /&amp;gt;
&amp;lt;/ISWebDesktop:WebFlyPostBackManager&amp;gt;&lt;/pre&gt;
&lt;ol style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt" start="3"&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;In Page_Load event, create an instance of WebFlyPostBackListener.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;protected void Page_Load(object sender, EventArgs e)
{
    WebFlyPostBackListener listener = new WebFlyPostBackListener(this.Page);
}&lt;/pre&gt;
&lt;ol style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt" start="4"&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;In the Button1_Click event handler, add following code in order to invoke the “refreshChild” JavaScript function.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;protected void Button1_Click(object sender, EventArgs e)
{
    WebFlyPostBackManager1.ClientAction.InvokeScript("button2_onclick();");
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The refresh of the child table is indicated by the appearance of “Refreshing child table…” text in the status bar of WebGrid.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Refresh Child table data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Child-table-data/</link><pubDate>Wed, 02 Mar 2011 08:50:01 GMT</pubDate><dc:creator>qawely</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Larry&lt;/p&gt;</description></item><item><title>Refresh Child table data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Child-table-data/</link><pubDate>Tue, 01 Mar 2011 23:16:52 GMT</pubDate><dc:creator>MarTin</dc:creator><description>&lt;p&gt;Hello Larry,&lt;/p&gt;
&lt;p&gt;To refresh child table, you simply need to use the following script:&lt;/p&gt;&lt;pre&gt;function refreshChild()
{
   var grid = ISGetObject("WebGrid1");
   grid.Tables["Orders"].Refresh();
}&lt;/pre&gt;

&lt;p&gt;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".&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;</description></item><item><title>Refresh Child table data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Child-table-data/</link><pubDate>Tue, 01 Mar 2011 11:36:28 GMT</pubDate><dc:creator>qawely</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a hierachical table with child tables. I wanted to refresh my child table but couldn't manage to do so.&lt;/p&gt;
&lt;p&gt;I've looked at some of the community posts and tried to refresh my child table via a script&lt;/p&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;function&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; refreshChild() { 

&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;   var&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; grid = ISGetObject(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;"WebGrid1"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;); 

&lt;p&gt;   grid.Tables[&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;"MyChildTable"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;].Refresh();   // Using DataMember name&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;and IN ASP&lt;/p&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;protected&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; Button1_Click(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; sender, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;EventArgs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; e) &lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; WebGrid1.ClientAction.InvokeScript(&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;"refreshChild();"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;);
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This doesn't work.&lt;/p&gt;
&lt;p&gt;I then tried &lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;
&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;Button&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;="Button1"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;Text&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;="Button"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;onclick&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;="Button1_Click"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;OnClientClick&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;="refreshChild()"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 

&lt;p&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;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 &lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;HierarchicalMode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;="LoadOnDemand" but does not make a difference. Would appreciate if someone can point me in the right direction.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 

&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
Larry&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;</description></item></channel></rss>