﻿<?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 - Rows in unbound hierarchic grid do not set Expand property when expanded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Rows-in-unbound-hierarchic-grid-do-not-set-Expand-property-when-expanded/</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>Rows in unbound hierarchic grid do not set Expand property when expanded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Rows-in-unbound-hierarchic-grid-do-not-set-Expand-property-when-expanded/</link><pubDate>Wed, 04 May 2011 10:25:50 GMT</pubDate><dc:creator>RobertPehrson</dc:creator><description>&lt;p&gt;You're right, Riendy, it's the ChildExpanded property that I need - it works fine.  The help could be clearer about this; as I understand "expanded", child rows are shown when the parent is expanded and not when the parent is collapsed. So f&lt;a&gt;or&lt;/a&gt; the Expanded property "Gets or sets a value that indicates whether the row is expanded" should read "... whether the row's &lt;span style="text-decoration:underline;"&gt;parent&lt;/span&gt; is expanded".  The ChildExpanded text is "Determines whether the Child Rows of current row is expanded" should read "... whether&lt;span style="text-decoration:underline;"&gt; this row&lt;/span&gt; is expanded".  &lt;/p&gt;
&lt;p&gt;Anyway, thanks for your help. &lt;/p&gt;</description></item><item><title>Rows in unbound hierarchic grid do not set Expand property when expanded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Rows-in-unbound-hierarchic-grid-do-not-set-Expand-property-when-expanded/</link><pubDate>Wed, 04 May 2011 06:15:19 GMT</pubDate><dc:creator>Riendy</dc:creator><description>&lt;p&gt;Hello Robert,&lt;/p&gt;&lt;p&gt;To get a rows that expanded by user, I think you get little bit missing. you should use ChildExpanded. You can try this code :&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&lt;pre&gt;&amp;lt;script type="text/javascript"&amp;gt;
        function OnClientCellDblClick(id, args) {
            var grid = ISGetObject(id);
            var rt = grid.RootTable;
            var rc = rt.GetRowsCount();
            var noneExpanded = true;
            for (i = 0; i &amp;lt; rc; i&amp;#43;&amp;#43;) {
                var r = rt.GetRow(i);
                
                if (r.ChildExpanded == true) {
                    alert('Row ' &amp;#43; i &amp;#43; ' is expanded');
                    noneExpanded = false;
                }
            }
            if (noneExpanded==true) alert('No rows are expanded');
        }
        function OnClientGroupExpand(id) {
            alert('group expanded');
        }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;&lt;/pre&gt;
&lt;p&gt; Would you like to tell me that I am right or not ?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Riendy&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Rows in unbound hierarchic grid do not set Expand property when expanded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Rows-in-unbound-hierarchic-grid-do-not-set-Expand-property-when-expanded/</link><pubDate>Tue, 03 May 2011 10:03:30 GMT</pubDate><dc:creator>RobertPehrson</dc:creator><description>&lt;p&gt;I have an unbound hierarchic grid where the user can expand and collapse the top level rows, and I need to be able to rebuild it on postback with the same rows expanded.  I tried using the Expand property of rows before the postback, but it is never set true.  I also tried handling the OnGroupExpand event, but this does not seem to fire. &lt;/p&gt;
&lt;p&gt;To demonstrate these problems, I've added to the Hierarchical_Unbound_Programmatic tutorial.  On the apsx, I added&lt;/p&gt;&lt;pre&gt;&amp;lt;script type="text/javascript"&amp;gt;
    function OnClientCellDblClick(id,args) {
        var grid = ISGetObject(id);
        var rt = grid.RootTable;
        var rc = rt.GetRowsCount();
        var noneExpanded = true;
        for (i = 0; i &amp;lt; rc; i&amp;#43;&amp;#43;) {
            var r = rt.GetRow(i);
            if (r.Expanded) {
                alert('Row ' &amp;#43; i &amp;#43; ' is expanded');
                noneExpanded = false;
            }
        }
        if (noneExpanded) alert('No rows are expanded');
    }

    function OnClientGroupExpand(id) {
        alert('group expanded');
    }
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;and in the code behind, I added to the Page_Load method&lt;/p&gt;&lt;pre&gt;        grid.LayoutSettings.ClientSideEvents.OnCellDblClick = "OnClientCellDblClick";
        grid.LayoutSettings.ClientSideEvents.OnGroupExpand = "OnClientGroupExpand";
&lt;/pre&gt;
&lt;p&gt;If you run the page and expand a line, the OnGroupExpand does not fire.  If you then double click on any cell, the OnClientCellDblClick function will not find any rows expanded.  &lt;/p&gt;</description></item></channel></rss>