﻿<?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 - checked rows in grid for export in VB</title><link>http://www.intersoftsolutions.com/Community/WebGrid/checked-rows-in-grid-for-export-in-VB/</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>checked rows in grid for export in VB</title><link>http://www.intersoftsolutions.com/Community/WebGrid/checked-rows-in-grid-for-export-in-VB/</link><pubDate>Sun, 31 Mar 2013 22:02:36 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p&gt;Hi Jarl,&lt;/p&gt;&lt;p&gt;I think the problem comes from method:&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'lucida grande', 'segoe ui', arial, verdana, tahoma; line-height: 18px; background-color: rgb(255, 255, 255);"&gt;For Each keyValue As String In WebGrid1.RootTable.GetCheckedRows()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This problem happen because WebGrid1.RootTable.GetCheckedRows() will produce array of WebGridRow instead of String. You should get the keyValue from its WebGridRow and you can compare it with your table keyValue. Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Bernard&lt;/p&gt;</description></item><item><title>checked rows in grid for export in VB</title><link>http://www.intersoftsolutions.com/Community/WebGrid/checked-rows-in-grid-for-export-in-VB/</link><pubDate>Thu, 28 Mar 2013 09:45:16 GMT</pubDate><dc:creator>jarl.hedin@svenskmjolk.se</dc:creator><description>&lt;p&gt;I tried this code and it,s not working. I took  your C# exampel and converted it  to VB&lt;/p&gt;
&lt;p&gt;what's wrong?  I get this error&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Best regards Jarl&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Undantagsinformation: &lt;/b&gt;System.NullReferenceException: Objektreferensen har 
inte angetts till en instans av ett objekt.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Källfel:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table width="100%" bgcolor="#ffffcc"&gt;
&lt;tbody&gt;
&lt;tr valign="" accesskey="" hidefocus="false" datasrc="null" implementation="null" class="" datafld="null" tabindex="0" dataformatas="null" bordercolor="" bordercolorlight="" bordercolordark="" bgcolor="" _attrinit="true" choff=""&gt;
&lt;td valign="" accesskey="" hidefocus="false" datasrc="null" implementation="null" class="" datafld="null" tabindex="0" dataformatas="null" bordercolor="" bordercolorlight="" bordercolordark="" bgcolor="" _attrinit="true" choff="" rowspan="1" colspan="1" nowrap="nowrap"&gt;&lt;code&gt;&lt;pre&gt;Rad 25:                 ' if current row is equal to one of the rows in the checked rows
Rad 26:                 ' then break
&lt;font style="color: red;"&gt;Rad 27:                 If e.Table.Rows(i).KeyValue.ToString() = keyValue Then
&lt;/font&gt;Rad 28:                     IsMatch = True
Rad 29:                     Exit For&lt;/pre&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;        Dim totalRows As Integer = WebGrid1.RootTable.Rows.Count&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For i As Integer = 0 To totalRows - 1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;            ' get the number of checked rows&lt;/p&gt;
&lt;p&gt;            Dim checkedRowsCount As Integer = WebGrid1.RootTable.GetCheckedRows().Count&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' a flag that shows whether row is match to one of the rows in the checked rows&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;            Dim IsMatch As Boolean = False&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each keyValue As String In WebGrid1.RootTable.GetCheckedRows()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;                ' if current row is equal to one of the rows in the checked rows&lt;/p&gt;
&lt;p&gt;                ' then break&lt;/p&gt;
&lt;p&gt;                If e.Table.Rows(i).KeyValue.ToString() = keyValue Then&lt;/p&gt;
&lt;p&gt;                    IsMatch = True&lt;/p&gt;
&lt;p&gt;                    Exit For&lt;/p&gt;
&lt;p&gt;                End If&lt;/p&gt;
&lt;p&gt;            Next&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' if current row is equal to one of the rows in the checked rows&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;            ' then passes to the next iteration&lt;/p&gt;
&lt;p&gt;            ' else remove current row&lt;/p&gt;
&lt;p&gt;            If IsMatch Then&lt;/p&gt;
&lt;p&gt;                Continue For&lt;/p&gt;
&lt;p&gt;            Else&lt;/p&gt;
&lt;p&gt;                e.Table.Rows.RemoveAt(i)&lt;/p&gt;
&lt;p&gt;                i -= 1&lt;/p&gt;
&lt;p&gt;                totalRows -= 1&lt;/p&gt;
&lt;p&gt;            End If&lt;/p&gt;
&lt;p&gt;        Next&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' set the "IsRowChecker" to be not visible during export&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;        e.Table.Columns.GetNamedItem("IsRowChecker").Visible = False&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; End Sub&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>