﻿<?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 - How to delete the child Table header when the child table data is empty?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-delete-the-child-Table-header-when-the-child-table-data-is-empty/</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>How to delete the child Table header when the child table data is empty?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-delete-the-child-Table-header-when-the-child-table-data-is-empty/</link><pubDate>Thu, 02 Aug 2012 23:23:02 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for your sample.&lt;br /&gt;&lt;br /&gt;After I investigated you code, it seems the issue persist due to mistakenness in your code.&lt;br /&gt;You already define the WebGrid’s structure from the beginning you create the WebGrid.&lt;br /&gt;Therefore, you couldn’t delete the structure just by using this code:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;WebGrid1.LayoutSettings.Hierarchical = false;WebGrid1.ClientAction.RefreshModifiedControls();&lt;/pre&gt;
&lt;p&gt;And as far I know, you couldn’t delete table by using this query code:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;string StrSql = "Delete from Schedules ";&lt;/pre&gt;
&lt;p&gt;However, if want to make any changes in your WebGrid’s structure.&lt;br /&gt;I recommend you to create the WebGrid’s structure programmatically.&lt;br /&gt;With this scenario, you could have more dynamic WebGrid’s structure.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to delete the child Table header when the child table data is empty?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-delete-the-child-Table-header-when-the-child-table-data-is-empty/</link><pubDate>Wed, 01 Aug 2012 21:16:24 GMT</pubDate><dc:creator>susu</dc:creator><description>&lt;p&gt;Hi Kristian ,&lt;/p&gt;
&lt;p&gt;This is my samples,please have a look! Thank you.&lt;/p&gt;</description></item><item><title>How to delete the child Table header when the child table data is empty?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-delete-the-child-Table-header-when-the-child-table-data-is-empty/</link><pubDate>Wed, 01 Aug 2012 02:34:43 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Could you please provide me a simple sample that replicate your issue?&lt;br /&gt;So I can help you to investigate your issue on my end.&lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to delete the child Table header when the child table data is empty?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-delete-the-child-Table-header-when-the-child-table-data-is-empty/</link><pubDate>Mon, 30 Jul 2012 22:44:57 GMT</pubDate><dc:creator>susu</dc:creator><description>&lt;p&gt;Hi Kristian ,&lt;/p&gt;
&lt;p&gt;Thank you very much,the child table is hide now,but the Hierarchical property does not work .first when I set the Hierarchical property to true,when the child table is empty, I hide the child table, I set the Hierarchical property to false,but it still show the Hierarchical show,how to hide it?&lt;/p&gt;</description></item><item><title>How to delete the child Table header when the child table data is empty?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-delete-the-child-Table-header-when-the-child-table-data-is-empty/</link><pubDate>Mon, 30 Jul 2012 08:02:18 GMT</pubDate><dc:creator>Hans</dc:creator><description>Hello,&lt;br /&gt;&lt;br /&gt;Yes, you could. You should set “ChildRowEmptyAction” property to “HideChildContent”.&lt;br /&gt;Then set a validation in OnAfterResponseProcess() client side event.&lt;br /&gt;Here’s the snippet code in OnAfterResponseProcess():&lt;br /&gt;&lt;pre&gt;function WebGrid1_OnAfterResponseProcess(controlId, actionName, lastRequestObject, xmlResponseObject) {    var WebGrid1 = ISGetObject(controlId);
    if (actionName == "DeleteRow") {
        var childRowsLenght = lastRequestObject.GetParentRow().GetChildRows().length;
        // if there is no child row any more
        if (childRowsLenght == 0) {
            // we need to refresh the WebGrid to apply the ChildRowEmptyAction property
            WebGrid1.Refresh();
        }
    }
    return true;
}&lt;/pre&gt;
&lt;p&gt;Also “RestoreExpandedChildRows” property to “True” and “RestoreRowSelection” to “All”.&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to delete the child Table header when the child table data is empty?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-delete-the-child-Table-header-when-the-child-table-data-is-empty/</link><pubDate>Fri, 27 Jul 2012 03:33:46 GMT</pubDate><dc:creator>susu</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When I use RootTables and ChildTables, when the childTables has data,it shows the data,but when I delete all of the childTables data, now it shows the header only in childTables,I wonder if it could realize that the childTables'header should hide because the childTables'data is empty. but I don't konw how to realize it. I konw set the Hierarchical="true" it support master and detail table show,but set  Hierarchical="false", it didn't show that, but in the behind code when I set Hierarchical="false",it also show the Hierarchical propertity. so could you please give me a hand?&lt;/p&gt;</description></item></channel></rss>