﻿<?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 - load the webgrid from the backend manually coded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/load-the-webgrid-from-the-backend-manually-coded/</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>load the webgrid from the backend manually coded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/load-the-webgrid-from-the-backend-manually-coded/</link><pubDate>Tue, 29 Sep 2009 04:06:34 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Please &lt;b&gt;pay attention&lt;/b&gt; to Glenn and my suggestion at the top. &lt;br /&gt;Please bind &lt;b&gt;&lt;i&gt;OnInitializeDataSource &lt;/i&gt;&lt;span style="font-weight: normal; "&gt;event and use &lt;/span&gt;&lt;i&gt;On&lt;/i&gt;&lt;i&gt;PrepareDataBinding&lt;/i&gt;&lt;span style="font-weight: normal; "&gt; to retrieve structure. &lt;br /&gt;As i see at your code, you put all of them together and not in proper event. To customize WebGrid settings such as grouping, filter and virtual load, please set &lt;/span&gt;&lt;i&gt;OnInitializeLayout&lt;/i&gt;&lt;span style="font-weight: normal; "&gt; event. &lt;br /&gt;I attached my working sample. Hope this helps.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>load the webgrid from the backend manually coded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/load-the-webgrid-from-the-backend-manually-coded/</link><pubDate>Tue, 29 Sep 2009 01:56:58 GMT</pubDate><dc:creator>ismail</dc:creator><description>&lt;p&gt;can you please give me a complete code of example, in which i can populate the webgrid from database using backend C# programming.&lt;span style="font-family: 'courier new'; font-size: 12px; white-space: pre; "&gt; &lt;/span&gt;&lt;/p&gt;&lt;pre&gt;        string condition = Request.QueryString["cond"];        string connectString = ConfigurationManager.ConnectionStrings["ConnectionString2"].ConnectionString;        OleDbConnection Connection1 = new OleDbConnection(connectString);        OleDbCommand Cmd = Connection1.CreateCommand();
        Cmd.CommandType = CommandType.Text;
        Cmd.CommandText = "SELECT MENU_PARAMETER_8 FROM ADM_MENU WHERE MENU_ID='" &amp;#43; condition &amp;#43; "'";
        Cmd.Connection.Open();
        OleDbDataAdapter da = new OleDbDataAdapter(Cmd);
        OleDbCommandBuilder comBuilder = new OleDbCommandBuilder(da);
        DataTable dt = new DataTable();
        da.Fill(dt);
        if (dt.Rows.Count &amp;gt; 0)
        {
            foreach (DataRow row in dt.Rows)
            {
                query = row[0].ToString();
            }
        }
        Cmd.Connection.Close();
        OleDbCommand Cmd1 = Connection1.CreateCommand();
        Cmd1.CommandType = CommandType.Text;
        Cmd1.CommandText = query;
        Cmd1.Connection.Open();
        OleDbDataAdapter da1 = new OleDbDataAdapter(Cmd1);
        OleDbCommandBuilder comBuilder1 = new OleDbCommandBuilder(da1);
        DataTable dt1 = new DataTable();
        da1.Fill(dt1);
        WebGrid1.DataSource = dt1;
        WebGrid1.RetrieveStructure();
        WebGrid1.DataBind();
        Cmd1.Connection.Close();&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;this is the code i have used. Here i am getting the data displayed on the grid. But with this any of the functionality of grid sucha as grouping , virtual load, filtering etc are not working.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;please reply me with example code and let me know how can enable features of your webgrid on that(like virtual load).&lt;/p&gt;</description></item><item><title>load the webgrid from the backend manually coded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/load-the-webgrid-from-the-backend-manually-coded/</link><pubDate>Tue, 22 Sep 2009 22:34:54 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;I suggest you to bind our WebGrid at &lt;i&gt;&lt;b&gt;OnInitializeDataSource&lt;/b&gt;&lt;/i&gt; event. As far I know, if the grid shows loaded number records on status bar but there is no data in WebGrid, it seems you forgot to &lt;b&gt;&lt;i&gt;RetrieveStructure&lt;/i&gt;&lt;/b&gt;. &lt;br /&gt;&lt;br /&gt;Below is the snippet code you need when you bind WebGrid programatically. Hope this helps.&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;protected void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
    if (!IsPostBack)
    {
            WebGrid1.RetrieveStructure();
    }
}&lt;/pre&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>load the webgrid from the backend manually coded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/load-the-webgrid-from-the-backend-manually-coded/</link><pubDate>Tue, 22 Sep 2009 22:32:36 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;In order to bind the data to WebGrid, please use InitializeDataSource server side event. Here is the snippet:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;protected void grdObj_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)&lt;br /&gt;{&lt;br /&gt;    //GetDataTable function will return DataTable object&lt;br /&gt;    e.DataSource = GetDataTable();&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;InitializeDataSource is recommended because this event will conform to Intersoft component life cycle, especially for the flypostback mechanism.  &lt;br /&gt;&lt;/p&gt;</description></item><item><title>load the webgrid from the backend manually coded</title><link>http://www.intersoftsolutions.com/Community/WebGrid/load-the-webgrid-from-the-backend-manually-coded/</link><pubDate>Tue, 22 Sep 2009 07:31:56 GMT</pubDate><dc:creator>ismail</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;i am trying to load the webgrid onthe page load even by the following code&lt;span style="font-family: 'courier new'; font-size: 12px; white-space: pre; "&gt;        OleDbCommand Cmd1 = Connection1.CreateCommand();&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;        Cmd1.CommandType = CommandType.Text;
        Cmd1.CommandText = query;
        Cmd1.Connection.Open();
        OleDbDataAdapter da1 = new OleDbDataAdapter(Cmd1);
        OleDbCommandBuilder comBuilder1 = new OleDbCommandBuilder(da1);
        DataTable dt1 = new DataTable();
        da1.Fill(dt1);
        WebGrid1.DataSource = dt1;
        WebGrid1.DataBind();
        Cmd1.Connection.Close();&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;But i am getting a webgrid with empty data.  In the bottom of the grid it shows the loaded number exactly.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;please help me to solve&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;thanks and regards&lt;/p&gt;
&lt;p&gt;ca&lt;/p&gt;</description></item></channel></rss>