﻿<?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 - CheckedRows cellValue</title><link>http://www.intersoftsolutions.com/Community/WebGrid/CheckedRows-cellValue/</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>CheckedRows cellValue</title><link>http://www.intersoftsolutions.com/Community/WebGrid/CheckedRows-cellValue/</link><pubDate>Fri, 12 Mar 2010 02:43:32 GMT</pubDate><dc:creator>yudi</dc:creator><category>GetCheckedRows cell value</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;GetCheckedRows() method returns object of HTML RowElement collection. In order to access the cell value or text of the checked rows, I suggest you to convert the HTML RowElement collection (returned by GetCheckedRows() method) into WebGridRow object first. After get the WebGridRow object, then you can access its cell value and/or text or any properties related to the respective cell.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Below is the snippet code that shows how to do the conversion plus how to obtain the cell properties.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;script type="text/javascript"&amp;gt;
    &amp;lt;!--
    function GetCurrentCheckedRows()
    {
        // retrieves WebGrid's object
        var grid = ISGetObject("WebGrid1");

        // access WebGrid's RootTable
        var rootTable = grid.RootTable;

        // get the current CheckedRows (return HTMLElement)
        var checkedRowsElement = grid.RootTable.GetCheckedRows();
        for (var i = 0 ; i &amp;lt; checkedRowsElement.length ; i&amp;#43;&amp;#43;)
        {
            // convert HTMLElement to WebGridRow object
            &lt;span style="color: #00b050"&gt;var row = rootTable.ToRowObject(checkedRowsElement[i]);&lt;/span&gt;
            &lt;span style="color: #00b050"&gt;alert(row.GetCells().GetNamedItem("CompanyName").Text);&lt;/span&gt;
            &lt;span style="color: #00b050"&gt;alert(row.GetCells().GetNamedItem("CompanyName").Value);&lt;/span&gt;
        }

        return true;
    }
    --&amp;gt;
&amp;lt;/script&amp;gt;&lt;/pre&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>CheckedRows cellValue</title><link>http://www.intersoftsolutions.com/Community/WebGrid/CheckedRows-cellValue/</link><pubDate>Thu, 11 Mar 2010 08:19:02 GMT</pubDate><dc:creator>desarrollo@pranasys.com</dc:creator><category>GetCheckedRows cell value</category><description>&lt;p&gt;I have a grid with a IsRowChecker column and i want to access a particular value on client side, for all the checked rows. &lt;br /&gt;&lt;br /&gt;When the user check a individual row the following code works fine. &lt;br /&gt;&lt;br /&gt;But when the user check all the rows with the checkbox in the row header, the cellValue property is undefined. &lt;br /&gt;&lt;br /&gt;How can i access the cell value? (The cell text and value must be differents)&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;/// Javascript function&lt;br /&gt;&lt;br /&gt;var grid = ISGetObject('WebGridComissions');&lt;br /&gt;var table = grid.GetRootTable();&lt;br /&gt;var checkedRows = table.GetCheckedRows();&lt;br /&gt;for (var i = 0; i &amp;lt; checkedRows.length; i&amp;#43;&amp;#43;){&lt;br /&gt;	alert(checkedRows[i].cells[4].cellValue); //Cell value&lt;br /&gt;	alert(checkedRows[i].cells[4].innerText); // Cell text&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/// Server side&lt;br /&gt;&lt;br /&gt;  protected void WebGridComissions_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (e.Row.Type == ISNet.WebUI.WebGrid.RowType.Record)&lt;br /&gt;        {&lt;br /&gt;            ISNet.WebUI.WebGrid.WebGridCellCollection cells = e.Row.Cells;&lt;br /&gt;            DataRowView dr = (DataRowView)e.Row.DataRow;                        &lt;br /&gt;            int classId = (int)dr["Id"];&lt;br /&gt;            cells.GetNamedItem("ClassName").Value = classId;&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;</description></item></channel></rss>