﻿<?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 - WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</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 bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Tue, 09 Aug 2011 21:18:54 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Glad to hear that the trick helps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Tue, 09 Aug 2011 16:42:41 GMT</pubDate><dc:creator>mpodbielski</dc:creator><description>I do that. thanks&lt;br /&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Mon, 08 Aug 2011 00:54:35 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;There are three general types of client data source:&lt;/span&gt;&lt;/p&gt;
&lt;ul style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;
Server-side data source.&lt;/li&gt;&lt;li&gt;
Service-based data source.&lt;br /&gt;ClientBinding&amp;trade; includes three built-in data providers implementation for data service, which are Web Service, WCF Service and ADO Data Service.&lt;/li&gt;&lt;li&gt;
Client-side data source.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;The exporting functionality needs to be processed at server-side. By nature, only server-side data source type which produce export result without any issues.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;However, there is a trick to have such feature work on the other two types of client data source (the service-based data source and client-side data source). In order to export the data when service-based data source or client-side data source is used, the &lt;strong&gt;BindingOperationMode&lt;/strong&gt; should be modified back to &lt;strong&gt;“ServerBinding”&lt;/strong&gt; temporarily.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;We can utilize the &lt;strong&gt;OnBeforeRequest&lt;/strong&gt; client-side event to modify the property &lt;strong&gt;only when the action is “Export”&lt;/strong&gt;. Please try to add following code inside the OnBeforeRequest client-side event.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnBeforeRequest(controlId, action) {
    var WebGrid1 = ISGetObject(controlId);
            
    if (action == "Export")
        WebGrid1.BindingOperationMode = "ServerBinding";    

    return true;
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Add the data source on WebGrid’s InitializeDataSource server-side event.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
    dsNorthwind.ProductsDataTable dt = new dsNorthwind.ProductsDataTable();
    dsNorthwindTableAdapters.ProductsTableAdapter da = new dsNorthwindTableAdapters.ProductsTableAdapter();
    da.Fill(dt);
    e.DataSource = dt;
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Last, configure the &lt;strong&gt;BindingOperationMode&lt;/strong&gt; property back to &lt;strong&gt;“ClientBinding”&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnBeforeRequest(controlId, action) {
    var WebGrid1 = ISGetObject(controlId);
            
    if (action == "Export")
        WebGrid1.BindingOperationMode = "ServerBinding";
    else
        WebGrid1.BindingOperationMode = "ClientBinding";

    return true;
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Sun, 07 Aug 2011 18:49:13 GMT</pubDate><dc:creator>mpodbielski</dc:creator><description>&lt;p&gt;Any news?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Tue, 26 Jul 2011 17:43:15 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;I was able to reproduce the problematic behavior on my local end. I will have this forwarded to WebGrid development team to be investigated further. Should I hear any news from the team regarding this issue, I will let you know as soon as possible.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Mon, 25 Jul 2011 19:31:10 GMT</pubDate><dc:creator>mpodbielski</dc:creator><description>&lt;p&gt; I use ClientBingdigMode with WebService and filtering and pagging works but when i try to export data to any format i've got JS error: "Invalid client service command"&lt;/p&gt;
&lt;p&gt;&lt;a href="http://buzzard.bhm.com.pl/Content/errorJS.jpg"&gt;&lt;img style="border-bottom: medium none; border-left: medium none; width: 679px; height: 295px; border-top: medium none; border-right: medium none" src="http://buzzard.bhm.com.pl/Content/errorJS.jpg" /&gt;&amp;nbsp;&lt;/a&gt;&lt;a href="http://buzzard.bhm.com.pl/Content/JScript.js" target="_blank"&gt;dynamic js code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Thu, 21 Jul 2011 21:24:08 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span&gt;The PagedData mode of Data Loading Mode in WebGrid’s 7 ClientBinding scenario works for client-based data service.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Wed, 20 Jul 2011 08:55:05 GMT</pubDate><dc:creator>mpodbielski</dc:creator><description>&lt;p&gt;Could I use ClientBinding and PaggedData with ObjectDataSource ?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Wed, 20 Jul 2011 08:10:38 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;It seems that the Select method in custom paging scenario doesn’t accept FilterExpression parameter. That should explain why does the FilterExpression parameter is always null.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;I suggest you to try PagedData mode of Data Loading Mode in WebGrid 7’s ClientBinding scenario. When data operation - such as sorting and filtering - is performed in PagedData mode, WebGrid will send a request to the specified data service by including complete request data in the selectArguments parameter. Developers are responsible to handle the sorting, filtering and paging based on the select arguments. In addition, WebGrid will also send a SelectCount request when it needs to invalidate the paging status.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;ClientBinding encapsulates essential select arguments into an object called DataSourceSelectArguments. This object is always passed to the parameter of your Select method.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;For more detail information, please check the “Data Loading Mode” topic in WebGrid’s documentation.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Tue, 19 Jul 2011 19:30:59 GMT</pubDate><dc:creator>mpodbielski</dc:creator><description>&lt;p&gt;Thanks for answer, the first issue is solved so I'm looking forward to hearing from you soon about the second one.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal &lt;/p&gt;</description></item><item><title>WebGrid bind to ObjectDataSource problem with customPagging and filtering</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-bind-to-ObjectDataSource-problem-with-customPagging-and-filtering/</link><pubDate>Sun, 17 Jul 2011 08:48:06 GMT</pubDate><dc:creator>mpodbielski</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I bind WG to ObjectDataSource ,&lt;/p&gt;&lt;pre&gt;&amp;lt;asp:ObjectDataSource ID="ObjectDataSource1" runat="server"  EnablePaging="true"
           MaximumRowsParameterName="maximumRows" SelectCountMethod="GetAllCount"
            SelectMethod="GetData" TypeName="ObjectDataSourceFilteringSample.DataItem"&amp;gt;
            &amp;lt;SelectParameters&amp;gt;
                &amp;lt;asp:Parameter Name="FilterExpression" Type="String" /&amp;gt;
                 &amp;lt;/SelectParameters&amp;gt;
        &amp;lt;/asp:ObjectDataSource&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;Pagging works almost perfect but when I go to second page ( from first to second or from third to second it doesn't matter) rows in change don't change , number of page change, when I click RefreshData button all rows disappear. I check selectMethod it return correct rows, and in another function where is another pagging logic also second page doesn't show proper no matter of page size.&lt;br /&gt;&lt;br /&gt; public List&amp;lt;Item&amp;gt; GetData(string FilterExpression, int startRowIndex, int maximumRows, string sortExpression)&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Second problem is filtering with customPagging. Parameter FilterExpression is always null, I don't know how to pass what users type in web. &lt;br /&gt;&lt;br /&gt;I attach a simple solutions with both issue.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://buzzard.bhm.com.pl/Content/ObjectDataSourceFilteringSample.zip"&gt;Sample Code&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>