﻿<?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 - Filtering data at WebGrid 7 with ClientBinding, Paging and ISLinqDatasource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Filtering-data-at-WebGrid-7-with-ClientBinding-Paging-and-ISLinqDatasource/</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>Filtering data at WebGrid 7 with ClientBinding, Paging and ISLinqDatasource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Filtering-data-at-WebGrid-7-with-ClientBinding-Paging-and-ISLinqDatasource/</link><pubDate>Mon, 02 Nov 2009 02:19:08 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>ClientBinding</category><category>Filter</category><category>Paging</category><category>ISLinqDataSource</category><description>&lt;p&gt;In a ClientBindind scenario, please use ClientBindingSettings ServiceEvents Selecting to add custom filter. This way the filter argument will be used during the data selecting (Paging will be taken into account)&lt;/p&gt;&lt;p&gt;Using the ClientBinding_Paging.aspx sample, add ServiceEvents Selecting. WebGrid Definition:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&amp;lt;ClientBindingSettings DataLoadMode="PagedData" DataSourceType="WebService" ItemTypeName="Bug"
    ServiceUrl="WebService.asmx"&amp;gt;
    &amp;lt;ServiceMethods BatchUpdateMethod="UpdateBugs" SelectMethod="GetPagedBugs" /&amp;gt;
    &lt;span style="color: rgb(255, 0, 0); "&gt;&amp;lt;ServiceEvents Selecting="WebGrid1_DataSelecting" /&amp;gt;&lt;/span&gt;
&amp;lt;/ClientBindingSettings&amp;gt;&lt;/pre&gt;
&lt;p&gt; Here is the event handler snippet, all filter action will filter the data which has Target value similar to &lt;i&gt;fut&lt;/i&gt; or &lt;i&gt;bug&lt;/i&gt;:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function WebGrid1_DataSelecting(gridObj, selectArgs) {
    if (selectArgs.FilterExpression != "")
        selectArgs.FilterExpression = "[Target] like 'fut' or [Target] like 'bug'";
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p&gt;   &lt;/p&gt;</description></item><item><title>Filtering data at WebGrid 7 with ClientBinding, Paging and ISLinqDatasource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Filtering-data-at-WebGrid-7-with-ClientBinding-Paging-and-ISLinqDatasource/</link><pubDate>Fri, 23 Oct 2009 06:12:21 GMT</pubDate><dc:creator>somer@optima.com.tr</dc:creator><category>ClientBinding</category><category>Filter</category><category>Paging</category><category>ISLinqDataSource</category><description>&lt;p&gt;I have a webgrid with clientbinding and paging which is connected a ISLinqDataSource (Datasource is Entity Framework).&lt;/p&gt;&lt;p&gt;I would like to return filtered data, but i cant use "filter column" property because of the design and security issues (for example: user may unhide hidden column and clear filter, or i can't apply more than one filter for a single column like "code like 'a%' or code like 'b%' ").&lt;/p&gt;
&lt;p&gt;And i cant use ISLinqDataSource's where property as WebGrid overrides it.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;So i dediced to use FilteredColumns.AdvancedFilterExpression property.&lt;/p&gt;
&lt;p&gt;It runs but has one important problem:&lt;/p&gt;
&lt;p&gt;AdvancedFilterExpression is applied not while querying database, but applied after retrieving data by WebGrid. So if you set paging with 25 rows, you may see less than 25 rows in a pages, even may be all pages with no rows. &lt;/p&gt;</description></item></channel></rss>