﻿<?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 - BindingOperationMode="ClientBinding" PrepareDataBinding doesn't run and grid show blank</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BindingOperationModeClientBinding-PrepareDataBinding-doesnt-run-and-grid-show-blank/</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>BindingOperationMode="ClientBinding" PrepareDataBinding doesn't run and grid show blank</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BindingOperationModeClientBinding-PrepareDataBinding-doesnt-run-and-grid-show-blank/</link><pubDate>Tue, 27 Jan 2015 02:31:42 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I will have this discussed with the WebGrid development team. I will get back to you with any news regarding this.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>BindingOperationMode="ClientBinding" PrepareDataBinding doesn't run and grid show blank</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BindingOperationModeClientBinding-PrepareDataBinding-doesnt-run-and-grid-show-blank/</link><pubDate>Fri, 23 Jan 2015 03:09:15 GMT</pubDate><dc:creator>alan@etimemachine.com</dc:creator><description>Hi Judi,&lt;br&gt;Is this the issue of Webgrid or Is this by designed?&lt;br&gt;Because I have to manually add/remove columns in PrepareDataBinding method. So if do like your suggestion, I'll have to duplicate code in PrepareDataBinding to Webgrid_Load. And this is not the best practice (duplicate code everywhere). Otherwise I have a hundreds of forms need to migrate and because of this issue I'll have much work to do.&lt;br&gt;Beside in your proposal &lt;a href="http://www.intersoftpt.com/Support/WebGrid/Documentation/topic462.html" target="_blank"&gt;here&lt;/a&gt;, I can see the flow that client side binding call initalizadatasource -&amp;gt; preparedatabinding. But in fact, your webgrid didn't call preparedatabinding when turn on client side "ServerDataSource" mode. I think this is your webgrid bug and if it is, please add it to your issues and tell me about the hotfix that fixed this bug.&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;</description></item><item><title>BindingOperationMode="ClientBinding" PrepareDataBinding doesn't run and grid show blank</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BindingOperationModeClientBinding-PrepareDataBinding-doesnt-run-and-grid-show-blank/</link><pubDate>Thu, 22 Jan 2015 08:08:12 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I managed to resolve this by removing RetrieveStructure() from PrepareDataBinding and add it to OnLoad server-side event (such as shown in the following snippet code).&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_PrepareDataBinding(object sender, DataSourceEventArgs e)
{
    // remove RetrieveStructure from
    // PrepareDataBinding server-side event
    // WebGrid1.RetrieveStructure();
}

protected void WebGrid1_Load(object sender, EventArgs e)
{
    // invoke RetrieveStructure in
    // OnLoad server-side event
    WebGrid1.RetrieveStructure();
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>BindingOperationMode="ClientBinding" PrepareDataBinding doesn't run and grid show blank</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BindingOperationModeClientBinding-PrepareDataBinding-doesnt-run-and-grid-show-blank/</link><pubDate>Tue, 20 Jan 2015 10:03:31 GMT</pubDate><dc:creator>alan@etimemachine.com</dc:creator><description>&lt;div&gt;Hi Intersoft,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I try to upgrade my webgrid from 6 to 9 using ClientBinding technology for best performance.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;But I found the issue that when using BindingOperationMode="ClientBinding" with PrepareDataBinding to build columns structure, it doesn't work.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;When the first time load (IsPostBack is false), WebGrid doesn't call PrepareDataBinding method. Hence the grid show data in blank (no column in client side).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This is my sample&lt;/div&gt;&lt;div&gt;File Default.aspx.cx&lt;/div&gt;&lt;div&gt;&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using ISNet.WebUI.WebGrid;

namespace TestWebGrid
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("CustomerID", typeof(string)));
            dt.Columns.Add(new DataColumn("CompanyName", typeof(string)));
            dt.Columns.Add(new DataColumn("Phone", typeof(string)));

            //if (((ISNet.WebUI.WebGrid.WebGrid)(sender)).ActionName == PostBackAction.LoadData)
            //{                  
                for (int i = 1; i &amp;lt;= 20; i++)
                    dt.Rows.Add(new object[] { i.ToString(), "Company " + i.ToString(), "12345678" + i.ToString() });
            //}
            e.DataSource = dt;
        }

        protected void WebGrid1_PrepareDataBinding(object sender, DataSourceEventArgs e)
        {
            WebGrid1.RetrieveStructure();
        }        
    }
}&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;File Default.aspx&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Courier New', Tahoma; font-size: 9pt; background-color: rgb(255, 252, 225);"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestWebGrid.Default" %&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;%@ Register assembly="ISNet.WebUI.WebGrid" namespace="ISNet.WebUI.WebGrid" tagprefix="ISWebGrid" %&amp;gt;

&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head runat="server"&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id="form1" runat="server"&amp;gt;
    &amp;lt;div&amp;gt;
    
        &amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="250px" UseDefaultStyle="True" Width="500px"                        
            BindingOperationMode="ClientBinding" OnInitializeDataSource="WebGrid1_InitializeDataSource" OnPrepareDataBinding="WebGrid1_PrepareDataBinding"&amp;gt;
            &amp;lt;LayoutSettings AllowContextMenu="False" ContextMenuAnimation="False" AlwaysShowHelpButton="False"&amp;gt;                 
            &amp;lt;/LayoutSettings&amp;gt;                    
        &amp;lt;/ISWebGrid:WebGrid&amp;gt;               
    &amp;lt;/div&amp;gt;
    &amp;lt;div&amp;gt;

    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Regards&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description></item></channel></rss>