﻿<?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 clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</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 clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Tue, 18 Jun 2013 06:58:04 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Hans,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;  Thank you, works great.  This functionality is a big asset for this web application.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;john&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>How to clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Tue, 18 Jun 2013 03:22:30 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for waiting.&lt;br /&gt;&lt;br /&gt;I set AllowGrouping property to “Yes” and I add a couple line of code in button click event to get the ContactName column value.&lt;br /&gt;&lt;br /&gt;Here’s the example snippet code:&lt;/p&gt;&lt;pre&gt;object objKeyValue = keyValue as object;TextBox1.Text &amp;#43;= WebGrid1.RootTable.GetUngrouppedRows().GetRowByKeyValue(objKeyValue).Cells.GetNamedItem("ContactName").Text &amp;#43; "\n";&lt;/pre&gt;
&lt;p&gt;Hope this helps. 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 clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Fri, 14 Jun 2013 12:23:17 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Well, I was able to fix the problem.  I had RestoreRowSelection set to RootTable, so the Row Checker field was always set.  Disabling RestoreRowSelection fixed this problem.  But another problem occurred and can be seen using your sample, with a slight modificiation.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;On the webgrid add AllowGrouping="Yes" to the Layout settings.  in the code behind right below the&lt;/p&gt;&lt;pre&gt;TextBox1.Text &amp;#43;= keyValue &amp;#43; "\n";&lt;/pre&gt;
&lt;p&gt;add this line&lt;/p&gt;&lt;pre&gt;object x = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("ContactName").Value;&lt;/pre&gt;
&lt;p&gt;Open the page in the browser, Group by the City field,  select a row and then click on button.  You will get an error on this new line, saying object reference is not set.  I need to get a value from the gird when I click on the button when Grouped By.   Any ideas?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Again this onl&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>How to clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Fri, 14 Jun 2013 11:22:18 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Your project works but mine doesn't but is more complex than your.  I have no idea what it causing the problem.  Not sure where to look, but this is killing my projects.&lt;/p&gt;
&lt;p&gt;This is my grid settings.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="320px" UseDefaultStyle="True"
                    Width="100%" DataCacheStorage="Session" EnableViewState="true" ViewStateStorage="PageCache"
                    EnableSection508Standards="False" RenderingMode="XHTML" EnableWebResources="Always"&amp;gt;
                    &amp;lt;LayoutSettings AllowFilter="Yes" AllowGrouping="Yes" AllowSorting="Yes" PagingMode="VirtualLoad"
                        VirtualLoadMode="Default" GroupByBoxVisible="False" AllowColumnFreezing="No" AllowColumnMove="Yes"
                        AllowExport="Yes" AlwaysShowHelpButton="false" AllowSelectColumns="Yes" RowLostFocusAction="NeverUpdate"
                        AutoFilterSuggestion="True" FilterBarVisible="false" HideColumnsWhenGrouped="No"
                        InProgressUIBehavior="ChangeCursorToHourGlass" PagingSize="25" ShowFilterStatus="True"
                        RestoreRowSelection="RootTableOnly" VirtualPageSize="25" PagingExportMode="ExportAllData"
                        AllowMultipleSelection="No" GroupRowInfoFormatDefault="[caption] : [value] ([count])"
                        ColumnFooters="No" HeaderClickAction="SortSingle" ShowColumnAction="true" RowHeaders="No"
                        CellClickAction="CellSelect" AutoFitColumns="false" PersistRowChecker="false"&amp;gt;
                        &amp;lt;FreezePaneSettings ShowInContextMenu="false" MaxFrozenColumns="1" AbsoluteScrolling="True" /&amp;gt;
                        &amp;lt;ClientSideEvents OnAfterInitialize="OnAfterInitialize" OnUnhandledError="WebGrid1_OnUnhandledError"
                            OnResponse="doLoad" /&amp;gt;
                        &amp;lt;AlternatingRowStyle Font-Names="Verdana" BackColor="#ECE9D8" Font-Size="8pt" HorizontalAlign="Center" /&amp;gt;
                        &amp;lt;RowStyle Font-Names="Verdana" Font-Size="8pt" HorizontalAlign="Center" BackColor="#c9c9c9" /&amp;gt;
                        &amp;lt;FooterStyle Font-Names="Verdana" BorderSettings-Left-Color="White" 
                            BorderSettings-Top-Color="White" &amp;gt;
                            &amp;lt;BorderSettings&amp;gt;
                                &amp;lt;Left Color="White" /&amp;gt;
                                &amp;lt;Top Color="White" /&amp;gt;
                                &amp;lt;left color="White" /&amp;gt;
                                &amp;lt;top color="White" /&amp;gt;
                            &amp;lt;/BorderSettings&amp;gt;
                        &amp;lt;/FooterStyle&amp;gt;
                        &amp;lt;StatusBarStyle BaseStyle="Normal" Font-Bold="True" Font-Size="9pt" BackColor="#b5d4eb"&amp;gt;
                        &amp;lt;/StatusBarStyle&amp;gt;
                        &amp;lt;TextSettings&amp;gt;
                            &amp;lt;TextItems&amp;gt;
                                &amp;lt;ISWebGrid:WebGridTextItem TextItem="CommonText/Refresh" TextValue="Refreshing Carriers" /&amp;gt;
                                &amp;lt;ISWebGrid:WebGridTextItem TextItem="CommonText/NoData" TextValue="There are no Carriers to display, modify the filters above to view Carriers" /&amp;gt;
                            &amp;lt;/TextItems&amp;gt;
                        &amp;lt;/TextSettings&amp;gt;
                    &amp;lt;/LayoutSettings&amp;gt;
                        &amp;lt;RootTable Caption="Carrier Information" TableHeaderVisible="False" DataKeyField="DOT_NUMBER"&amp;gt;
                        &amp;lt;HeaderStyle BackColor="#3d4351" BorderStyle="Solid" BorderWidth="1px" Wrap="true"
                            Cursor="Hand" Font-Names="Verdana" Font-Size="8pt" ForeColor="White" Font-Bold="true"
                            HorizontalAlign="Center" CssClass="WG5-Header" CustomRules="height:auto"&amp;gt;
                            &amp;lt;BorderSettings&amp;gt;
                                &amp;lt;Left Color="#3d4351" /&amp;gt;
                                &amp;lt;Top Color="#3d4351" /&amp;gt;
                                &amp;lt;Bottom Color="#3d4351" /&amp;gt;
                            &amp;lt;/BorderSettings&amp;gt;
                        &amp;lt;/HeaderStyle&amp;gt;&lt;/pre&gt;
&lt;p&gt;This is the button click code:  The first time is fine, if I select other records after postback, the count of CheckedRows includes the records from the first attempt.  This is also occurring when using a group by.  I am also filling the gris using the InitalizeDataSource event.  Any ideas?  Is jQuery inteferring?&lt;/p&gt;&lt;pre&gt;    Protected Sub btnAssign_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAssign.Click
        If Page.IsValid Then
            Dim checkedRows As ArrayList = WebGrid1.RootTable.GetCheckedRows()
            Dim textValue As String = String.Empty
            Dim dot_number As String = String.Empty
            Dim entry_date As String = String.Empty
            Dim ostate As String = String.Empty
            Dim day_90_date As String = String.Empty
            Dim audit_type As String = String.Empty
            Dim offsite_eligable As String = String.Empty
            Dim carrier_name As String = String.Empty
            Dim ne_status As String = String.Empty
            Dim ne_exit_date As String = String.Empty

            Dim success As Boolean = False
            Dim i As Integer = checkedRows.Count

            For Each keyValue As String In checkedRows
                dot_number = keyValue
                carrier_name = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("CarrierName").Value
                entry_date = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("EntryDate").Value
                ostate = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("OICState").Value
                day_90_date = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("Day90Ltr").Value.ToString
                audit_type = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("AuditType").Value.ToString
                offsite_eligable = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("OffsiteEligable").Value.ToString
                ne_status = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("NEStatus").Value.ToString
                ne_exit_date = WebGrid1.RootTable.Rows.GetRowByKeyValue(keyValue).Cells.GetNamedItem("ExitDate").Value.ToString

                success = AssignCarrier(i, dot_number, ostate, entry_date, day_90_date, audit_type, offsite_eligable, carrier_name, ne_status, ne_exit_date)
            Next
            ' clear the insput field
            clearFields()

            ' rebind grid
            'WebGrid1.RootTable.GetCheckedRows().Clear()
            WebGrid1.ClearCachedDataSource()
            WebGrid1.RebindDataSource()
            ' This forces a rebinding of the grid,  not a very good way but appears the CheckedRows are not cleared out!
            'Response.Redirect("~/SA/unassigned.aspx", True)
        End If
    End Sub&lt;/pre&gt;
</description></item><item><title>How to clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Fri, 14 Jun 2013 10:47:58 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;I'll take  look at your project and get back to you. &lt;/p&gt;</description></item><item><title>How to clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Thu, 13 Jun 2013 22:37:40 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I have tried to modify one of WebGrid samples, RowCheckerColumn.aspx page.&lt;br /&gt;I set the PersistRowChecker property to “false”. I also modified the validation code in button click server side event.&lt;br /&gt;The result is there is no checked row collection any more after post back process.&lt;br /&gt;&lt;br /&gt;I attached two video about what I get on my end.&lt;br /&gt;The first video is the result when I set the PersistRowChecker property to “false” and the second is the result when I set the PersistRowChecker property to “true”.&lt;br /&gt;&lt;br /&gt;Please kindly have review on the modified sample as well. To run the sample, just simple add the sample to WebGrid Samples solution.&lt;br /&gt;&lt;br /&gt;Please correct me if wrong. 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 clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Thu, 13 Jun 2013 07:04:48 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Nope it doesn't clear the checked rows.  It clears them from the Grid but if you look at the CheckedRows collection the previous selections are still there.&lt;/p&gt;</description></item><item><title>How to clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Thu, 13 Jun 2013 02:17:32 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Perhaps you could try to set the PersistRowChecker property to "false". It will automatically clear all checked rows after post back process.&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 clear the CheckedRows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-clear-the-CheckedRows-server-side/</link><pubDate>Wed, 12 Jun 2013 11:31:19 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;On my grid I have a RowChecker column.  A user will select one or more rows to do some action.  A button is clicked and all checkedrows are found and processed.  At the end the CacheDataSource is cleared and then rebind the grid.  This all works fine.  The problem now occurs when the user attempts to select another row and run the process again.  When I look at what is returned from the getCheckedRows funtion is the new record selected as well as the row selected in the previous selection, but since that previous record is no longer in the grid and error occurs.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;How can I clear the CheckedRows between postbacks on server side?  I've tried GetCheckedRows().clear but that didn't seem to work.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>