﻿<?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 - Prevent RowChecker 'Check All' from modifying disabled checker cell</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Prevent-RowChecker-Check-All-from-modifying-disabled-checker-cell/</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>Prevent RowChecker 'Check All' from modifying disabled checker cell</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Prevent-RowChecker-Check-All-from-modifying-disabled-checker-cell/</link><pubDate>Mon, 07 Jun 2010 02:30:45 GMT</pubDate><dc:creator>yudi</dc:creator><category>WebGrid</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Please try to put following code into ‘OnCheckBoxClick’ client side event of WebGrid.&lt;/span&gt;&lt;/p&gt;&lt;pre style="font-family: 'courier new'; font-size: 10pt"&gt;&lt;span style="font-family: 'courier new'; color: blue; font-size: 10pt"&gt;function&lt;/span&gt; WebGrid1_OnCheckBoxClick(controlId, tblName, colName, checkboxValue, originalCheckBoxValue) {
    &lt;span style="font-family: 'courier new'; color: blue; font-size: 10pt"&gt;var&lt;/span&gt; WebGrid1 = ISGetObject(controlId);
    &lt;span style="font-family: 'courier new'; color: blue; font-size: 10pt"&gt;var&lt;/span&gt; chkBoxElem = WebGrid1.LastChkBox;

    &lt;span style="font-family: 'courier new'; color: blue; font-size: 10pt"&gt;if&lt;/span&gt; (chkBoxElem.getAttribute(&lt;span style="font-family: 'courier new'; color: #a31515; font-size: 10pt"&gt;"disabled"&lt;/span&gt;) == &lt;span style="font-family: 'courier new'; color: blue; font-size: 10pt"&gt;true&lt;/span&gt;)
        chkBoxElem.checked = originalCheckBoxValue;

    &lt;span style="font-family: 'courier new'; color: blue; font-size: 10pt"&gt;return true&lt;/span&gt;;
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;The idea is get the ‘checked’ attribute of the disabled checkbox element to the original checkbox value. Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Prevent RowChecker 'Check All' from modifying disabled checker cell</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Prevent-RowChecker-Check-All-from-modifying-disabled-checker-cell/</link><pubDate>Fri, 04 Jun 2010 11:46:23 GMT</pubDate><dc:creator>Gmontes</dc:creator><category>WebGrid</category><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm disabling some checker cells in the InitializeRow event, but these are somehow still editable through the 'Check All' checkbox that's avaible on the header of the checker column.&lt;/p&gt;
&lt;p&gt;I'm disabling the cells in the initializeRow with a snippet like this:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;if (e.Row.Type == RowType.Record)
            {
                //Get the checker cell
                WebGridCellCollection cells = e.Row.Cells;
                var checkerCell = cells[0];
                //Randomize
                bool disabled = cells[2].Text.Length % 2 ==0;
                checkerCell.ForceNoEdit = disabled;
            }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;But when I click the 'Check All' checkbox they end up checked/unchecked anyways.&lt;/p&gt;
&lt;p&gt;Is there a way to prevent this? I was think of reversing the value on the OnCheckBoxClick clientside event, but the issue persists. I was using something like this:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function DoNotCheckDisabled(gridId, tblName, colName, checkboxValue, originalCheckboxvalue) {
        var grid = ISGetObject(gridId);
        var row = grid.Tables[tblName].ToRowObject(grid.CheckedRowContext);
        if (checkerCell = row.GetCell('Checker').ForceNoEdit == true) {
            row.GetCell('Checker').SetValue(false, true);             
        }        
    }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;Any ideas would be appreciated.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item></channel></rss>