﻿<?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 - Strange WebGrid error using filtered columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Strange-WebGrid-error-using-filtered-columns/</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>Strange WebGrid error using filtered columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Strange-WebGrid-error-using-filtered-columns/</link><pubDate>Fri, 04 Oct 2013 07:21:31 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>Hans,&lt;br /&gt;&lt;br /&gt;&amp;nbsp; Thank you this helped.&amp;nbsp; I was using a multiview control with a different grid in each view and the structures were different.&amp;nbsp; Even though only one view was dispayed at a time, both were being populated.&amp;nbsp; Since one grid was different, it was trying to apply the filter to both grids, thus the error.&amp;nbsp; Just forgot to load only one grid at a time!&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Again Thanks for your help.&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Strange WebGrid error using filtered columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Strange-WebGrid-error-using-filtered-columns/</link><pubDate>Fri, 04 Oct 2013 04:05:20 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for the question.&lt;br /&gt;&lt;br /&gt;After I investigate this filter issue, it seems the issue occurs due to we want to filter the column when the column hasn’t rendered yet.&lt;br /&gt;&lt;br /&gt;I attached 2 WebGrid samples which show that we should / can filter a column after the column is already rendered (ready to be filtered)&lt;br /&gt;&lt;br /&gt;In this sample, I bind the WebGrid programmatically (with OleDbConnection).&lt;br /&gt;I add filtering code in PrepareDataBinding server side event. In that event I also add RetrieveStructure() method (to retrieve Column's structure).&lt;br /&gt;&lt;br /&gt;In the first WebGrid sample, I put the RetrieveStructure() method “before” filtering code. The result is the filtering works fine.&lt;br /&gt;Here’s the snippet code:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e){
    if (!IsPostBack)
    {
        WebGrid1.RetrieveStructure();
        WebGridFilter fltr = new WebGridFilter("ShipName", ColumnFilterType.Contain, "Vins");
        WebGrid1.RootTable.FilteredColumns.Add(fltr);            
    }
}&lt;/pre&gt;
&lt;p&gt;In the second sample, I put the RetrieveStructure() method “after” filtering code. The result is I got the same error message as yours.&lt;br /&gt;Here’s the snippet code:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
    if (!IsPostBack)
    {
        WebGridFilter fltr = new WebGridFilter("ShipName", ColumnFilterType.Contain, "Vins");
        WebGrid1.RootTable.FilteredColumns.Add(fltr);
        WebGrid1.RetrieveStructure();
    }
}&lt;/pre&gt;
&lt;p&gt;Therefore, please kindly re-check / review your application’s code, whether the column is already rendered or not, when you try to filter it.&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Strange WebGrid error using filtered columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Strange-WebGrid-error-using-filtered-columns/</link><pubDate>Thu, 03 Oct 2013 14:07:10 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;I'm getting a strange error that I can't determine what the problem is and hoping that you may see something fom the stack trace that could help me in finding the problem.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I have a standard grid (v8), where when a user sets a filter that filter is saved off for use when the user returns back to this page.  The saving and restoring of the filters is working and looks correct.   With most of the columns there is no problem but there are 3 columns (no different from the other columns) that when teh filter is restored the error in the attached file occurs.  I know I won't be able to create a simple page that shows the error, so hoping the stack trace gives some clue!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>