﻿<?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 - keyvalue</title><link>http://www.intersoftsolutions.com/Community/Tags/keyvalue/</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>Get KeyValue when webgrid mode is group by (GroupHeader)</title><link>http://www.intersoftsolutions.com/Community/Tags/keyvalue/</link><pubDate>Wed, 24 Feb 2016 13:18:59 GMT</pubDate><dc:creator>sjain</dc:creator><category>WebGrid</category><category>keyvalue</category><category>GroupHeader</category><description>&lt;p&gt;Hi,&lt;/p&gt;        &lt;p&gt;I went through your documentation for getting keyvalue when we do wedbgrid in groupby mode.&lt;/p&gt;    
    &lt;p&gt;https://www.intersoftsolutions.com/Support/WebGrid/Documentation/topic495.html&lt;/p&gt;
    &lt;pre&gt;function GetCellText()
{
    var grid = ISGetObject("WebGrid1");
    var curSelObj = grid.GetSelectedObject(); // get selected object

    if (curSelObj == null)
    {
        alert("No row selected. Please select a row");
    }
    else
    {
        var row = curSelObj.GetRowObject(); // get the WebGridRow object

        if (row.Type == "GroupHeader")
        {
            alert("Currently selected row is a Group Row. There is no cell information.");
        }
        else if (row.Type == "Record")
        {
            var cells = row.GetCells(); // obtain WebGridCellCollection of the specified row.
            var addressCell = cells.GetNamedItem("Address"); // get the address' WebGridCell object by name.

            alert("Current selected row's Address cell has this text : " + addressCell.Text + "\nThe cell's value is : " + (addressCell.Value == null ? "No Value" : addressCell.Value));
        }
    }
}&lt;/pre&gt;
    
    &lt;p&gt;on the above method you have clearly mentoined when record type is GroupHeader then "Currently selected row is a Group Row. There is no cell information".&lt;/p&gt;
    &lt;p&gt;I need KeyValue when webgrid is in Group by mode on OnCellClick(controlId, tblName, rowIdx, cellIdx, cellElm) event.&lt;/p&gt;
    &lt;p&gt;I am able to get keyvalue when grid is NOT IN group by mode as bellow:&lt;/p&gt;
    &lt;pre&gt;var WebRow = WebGrid1.RootTable.GetRow(rowIdx);

if (WebRow != null)
{
    if ((ColumnName == "XYZ") &amp;amp;&amp;amp; rowIdx != -1)
    {
        if ((browserDocumentMode &amp;gt;= 11 &amp;amp;&amp;amp; cellElm.childElementCount &amp;gt; 0) || (browserDocumentMode &amp;lt; 11 &amp;amp;&amp;amp; cellElm.all.length &amp;gt; 0))
        {
            openDetails(WebRow.KeyValue);
        }
    }
}&lt;/pre&gt;
    &lt;p&gt;Please reply ASAP.&lt;/p&gt;
    &lt;br&gt;
    &lt;p&gt;Regards&lt;/p&gt;
    &lt;p&gt;Sachin Jain&lt;/p&gt;</description></item></channel></rss>