﻿<?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 - GetCheckedRows</title><link>http://www.intersoftsolutions.com/Community/Tags/GetCheckedRows/</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>WebGrid RowChecker column not persisting on postback so GetCheckedRows is always empty</title><link>http://www.intersoftsolutions.com/Community/Tags/GetCheckedRows/</link><pubDate>Tue, 14 Jun 2011 09:34:18 GMT</pubDate><dc:creator>neil.turner@ntd.co.uk</dc:creator><category>WebGridRowChecker</category><category>RowChecker</category><category>GetCheckedRows</category><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have a Webgrid with a RowChecker and a button to run an action on the checked rows.&lt;/p&gt;
&lt;p&gt;However getCheckedRows always returs empty and on clickikg the button all the checkboxes in the grid are cleared.&lt;/p&gt;
&lt;p&gt;I have coopied the code posted on this forum before but it still returns 0. I am using WebGrid 7&lt;/p&gt;
&lt;p&gt;This is the op of my grid&lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;    &amp;lt;ISWebGrid:WebGrid ID="wgArchive" runat="server" DataSourceID="sdsAppointments"&amp;gt;&lt;/p&gt;
&lt;p&gt;        &amp;lt;RootTable Caption="Visits" DataKeyField="EntityId"&amp;gt;&lt;/p&gt;
&lt;p&gt;            &amp;lt;Columns&amp;gt;&lt;/p&gt;
&lt;p&gt;                &amp;lt;ISWebGrid:WebGridColumn ColumnType="CheckBox" IsRowChecker="True" Name="RowChecker"&amp;gt;&lt;/p&gt;
&lt;p&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;And this is the code the button runs&lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;        protected void btnArchive_Click(object sender, EventArgs e)&lt;/p&gt;
&lt;p&gt;        {&lt;/p&gt;
&lt;p&gt;            lbMsg.Text = wgArchive.RootTable.Rows.Length.ToString() &amp;#43; " rows affected ";&lt;/p&gt;
&lt;p&gt;            foreach (string keyValue in wgArchive.RootTable.GetCheckedRows())&lt;/p&gt;
&lt;p&gt;            {&lt;/p&gt;
&lt;p&gt;                lbMsg.Text &amp;#43;= keyValue &amp;#43; " ; \n";&lt;/p&gt;
&lt;p&gt;            }&lt;/p&gt;
&lt;p&gt;        }&lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;</description></item></channel></rss>