﻿<?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 - Tell if grid is filtered</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Tell-if-grid-is-filtered/</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>Tell if grid is filtered</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Tell-if-grid-is-filtered/</link><pubDate>Mon, 23 Sep 2013 23:16:48 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Glad to hear the good news.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;em&gt;OnAfterInitialize&lt;/em&gt; specifies the client side (JavaScript) function that will be invoked after WebGrid had been initialized; and &lt;em&gt;OnAfterResponseProcess&lt;/em&gt; specifies the client side (JavaScript) function that will be invoked after the response action of a request has been performed. For more detail information regarding ClientEvents of WebGrid, please refer to &lt;a href="http://www.intersoftpt.com/Support/WebGrid/Docs/topic863.html"&gt;ClientEvents Class Members&lt;/a&gt; section in WebGrid documentation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Should you need further assistance or run into any problems regarding our controls, feel free to post it into our community site. We would be happy to assist you again.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Tell if grid is filtered</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Tell-if-grid-is-filtered/</link><pubDate>Mon, 23 Sep 2013 07:40:45 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>Hi Yudi,&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; Thank you very much, works great.&amp;nbsp; I was thinking along that line, but I was using the wrong event.&amp;nbsp; Again thank you for great help.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;john&lt;br /&gt;</description></item><item><title>Tell if grid is filtered</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Tell-if-grid-is-filtered/</link><pubDate>Mon, 23 Sep 2013 00:34:04 GMT</pubDate><dc:creator>yudi@intersoftpt.com</dc:creator><description>&lt;blockquote&gt;...&lt;p&gt; I have a page where the user can 1) go directly to the grid page unfiltered or 2) go to the gird via a filter (set programically). In this case neither of the client events runs. What I need to do is to duplicate the Filtered/Unfiltered message that displays in the status bar. I need to know at anytime what the status of the filter state is. Users don't look at the status bar so I need a way to tell the user via a RED MESSGE at top of grid, the filter status. Is this possible?&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I created a simple sample of WebGrid based on Hans's sample. The grid shows &lt;em&gt;Customers&lt;/em&gt; data from &lt;em&gt;Northwind.mdb&lt;/em&gt; file. Filtered columns are programmatically added during PrepareDataBinding server-side event in order to emulate scenario 1 and scenario 2 (as shown in the above quoted paragraph).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I’m using &lt;strong&gt;OnAfterInitialize&lt;/strong&gt; client-side event of WebGrid to get the filter state of WebGrid which can't be handled by either &lt;strong&gt;OnColumnFilter&lt;/strong&gt; or &lt;strong&gt;OnAfterResponseProcess&lt;/strong&gt; event. This event invokes &lt;strong&gt;ShowFilterInformation()&lt;/strong&gt; JavaScript function which will display filter information in a text area element.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnAfterInitialize(controlId)
{
    var WebGrid1 = ISGetObject(controlId);
    ShowFilterInformation(WebGrid1);
    return true;
}
function ShowFilterInformation(controlId)
{
    var textArea1 = document.getElementById("textArea1");
    if (controlId.RootTable.FilteredColumns.length &amp;gt; 0)
    {
        textArea1.value = "WebGrid1 is filtered" &amp;#43; "\n" 
                            &amp;#43; "FilteredColumns detail information:" &amp;#43; "\n";
        for (var i = 0; i &amp;lt; controlId.RootTable.FilteredColumns.length; i&amp;#43;&amp;#43;)
        {
            var filteredColumns = controlId.RootTable.FilteredColumns[i];
            textArea1.value &amp;#43;= "Column " &amp;#43; filteredColumns.ColumnMember.toString() &amp;#43; " is "
                                &amp;#43; filteredColumns.FilterType.toString() &amp;#43; " "
                                &amp;#43; filteredColumns.FilterText.toString() &amp;#43; "\n";
        }
    }
    else
        textArea1.value = "WebGrid1 is not filtered";
    return true;
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Last, simply do the same in OnAfterResponseProcess client-side event to show filter information when user interacts from client-side.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Please have the attached sample file evaluated on your end and let us hear whether this helps or not.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Tell if grid is filtered</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Tell-if-grid-is-filtered/</link><pubDate>Fri, 20 Sep 2013 08:58:18 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Hi Hans,&lt;/p&gt;&lt;p&gt;Thanks, is there a way to tell what the filter is? or if its filtered or unfiltered? The OnColumnFilter only runs if you filter via the filter bar or context menu.&lt;/p&gt;
&lt;p&gt;I have a page where the user can 1) go directly to the grid page unfiltered or 2) go to the gird via a filter (set programically). In this case neither of the client events runs. What I need to do is to duplicate the Filtered/Unfiltered message that displays in the status bar. I need to know at anytime what the status of the filter state is. Users don't look at the status bar so I need a way to tell the user via a RED MESSGE at top of grid, the filter status. Is this possible?&lt;/p&gt;</description></item><item><title>Tell if grid is filtered</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Tell-if-grid-is-filtered/</link><pubDate>Fri, 20 Sep 2013 04:13:27 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;To know/check whether the filter has been applied to the WebGrid, you could use OnColumnFilter or and OnAfterResponseProcess client side event.&lt;br /&gt;&lt;br /&gt;Here’s the example snippet code regarding the client side event:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnAfterResponseProcess(controlId, action, lastRO, xmlRO) {    var WebGrid1 = ISGetObject(controlId);
    alert(action);
    return true;
}
function WebGrid1_OnColumnFilter(controlId, tableObject) {
    var WebGrid1 = ISGetObject(controlId);
    alert("Column is Filtered");
    return true;
}&lt;/pre&gt;
&lt;p&gt;I also attach the example page about how I use/implement the client side event.&lt;br /&gt;&lt;br /&gt;Please kindly have a review on the page to see result.&lt;br /&gt;&lt;br /&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>Tell if grid is filtered</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Tell-if-grid-is-filtered/</link><pubDate>Thu, 19 Sep 2013 10:55:48 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Is there an way that I can tell if a filter has been applied to the grid?  I need to put up a message to the user when a filter has been added (whether it was done via the filter bar or programmatically).  I need to duplicate the "Filtered" icon that is already displayed in the status area.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;thanks&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>