﻿<?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 - how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</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>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</link><pubDate>Tue, 31 Aug 2010 03:19:32 GMT</pubDate><dc:creator>qq397472251</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;p&gt;&lt;span class="postusername"&gt;thank you &amp;nbsp;&lt;a class="contentlink" href="http://www.intersoftpt.com/Community/Users/handy@intersoftpt.com/"&gt;Handy Surya&lt;/a&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;&lt;strong&gt;the answer is perfect!&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;&lt;/span&gt; &lt;/p&gt;</description></item><item><title>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</link><pubDate>Tue, 31 Aug 2010 02:36:48 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;p&gt;Hello, &lt;/p&gt;&lt;p&gt;Please see my attached sample. I bind WebGrid with diffrent tables via button. Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</link><pubDate>Mon, 30 Aug 2010 21:06:39 GMT</pubDate><dc:creator>qq397472251</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;pre&gt;&lt;strong&gt;Like this:&lt;/strong&gt;&lt;/pre&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 H.Database;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ISNet.WebUI.WebGrid;
using ISNet.WebUI.WebCombo;

namespace WebApplication1
{
    public partial class Demo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindList();
            }
        }
        protected void BindList()
        {
            using (StoreDA da = new StoreDA())
            {
                var aa = da.Query();

                this.WebGrid1.DataSource = da.Query1(TextBox1.Text);
                WebGrid1.RetrieveStructure();
                WebGrid1.DataBind();   
             
                WebGrid1.RootTable.DataKeyField = "序列号";
                WebGrid1.RootTable.Columns.GetNamedItem("序列号").IsRowChecker = true;
                         }
        }

          protected void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
        {
            //  BindList();
            using (StoreDA da = new StoreDA())
            {
                var aa = da.Query1("");//this is a  query SQl,get a datatable
                e.DataSource = aa;
                WebGrid1.RetrieveStructure();
                WebGrid1.RootTable.DataKeyField = "序列号";
                WebGrid1.DataBind();
                WebGrid1.RootTable.Columns.GetNamedItem("序列号").IsRowChecker = true;
            }
        }

        protected void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            using (StoreDA da = new StoreDA())
            {
                var aa = da.Query1(TextBox1.Text);
                WebGrid1.DataSource = aa;
                WebGrid1.RetrieveStructure();
                WebGrid1.RootTable.DataKeyField = "序列号";
                WebGrid1.DataBind();
                WebGrid1.RootTable.Columns.GetNamedItem("序列号").IsRowChecker = true;
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            using (StoreDA da = new StoreDA())
            {
                var aa = da.Query2(TextBox2.Text);
                WebGrid1.DataSource = aa;
                WebGrid1.RetrieveStructure();
                WebGrid1.RootTable.DataKeyField = "序列号";
                WebGrid1.DataBind();
                WebGrid1.RootTable.Columns.GetNamedItem("序列号").IsRowChecker = true;
            }
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            using (StoreDA da = new StoreDA())
            {
                var aa = da.Query3(TextBox3.Text);
                WebGrid1.DataSource = aa;
                WebGrid1.RetrieveStructure();
                WebGrid1.RootTable.DataKeyField = "序列号";
                WebGrid1.DataBind();
                WebGrid1.RootTable.Columns.GetNamedItem("序列号").IsRowChecker = true;
            }
        }

        protected void Button4_Click(object sender, EventArgs e)
        {
            using (StoreDA da = new StoreDA())
            {
                var aa = da.Query4(TextBox4.Text);
                WebGrid1.DataSource = aa;
                WebGrid1.RetrieveStructure();
                WebGrid1.RootTable.DataKeyField = "序列号";
                WebGrid1.DataBind();
                WebGrid1.RootTable.Columns.GetNamedItem("序列号").IsRowChecker = true;
            }
        }
    &lt;br /&gt;
    when I input some informations and click a&amp;nbsp;button,get a new dataset,I want bind the dataset to the same webgrid!How can I do ?Please help me!thank you!&lt;/pre&gt;</description></item><item><title>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</link><pubDate>Mon, 30 Aug 2010 04:05:55 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;So, if you don't want to use DropDownList, may I know how do you want to bind your WebGrid dynamically? &lt;br /&gt;There should be someway you used to trigger bind dynamically in your scenario. &lt;/p&gt;
&lt;p&gt;e.g in my sample, I used DropDownList. &lt;br /&gt;So, I need to know the detail before can suggest you a sample.&lt;/p&gt;
&lt;p&gt;I am sure that our WebGrid supports multiTables.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</link><pubDate>Mon, 30 Aug 2010 03:12:51 GMT</pubDate><dc:creator>yudi</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;WebGrid supports your required scenario that binds WebGrid to multiple dataset.&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 enclosed a sample where WebGrid initially bind to ‘Categories’ dataset of Northwind.mdb database. After the page load, you can change WebGrid’s datasource by selecting a table from the dropdownlist. You can still perform sorting, grouping, column moving and resizing after the new datasource has been applied.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Please check the attached sample for more detail information.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</link><pubDate>Sun, 29 Aug 2010 21:38:10 GMT</pubDate><dc:creator>qq397472251</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;p&gt;&lt;span class="postusername"&gt;hi &lt;/span&gt;&lt;span class="postusername"&gt;&lt;a class="contentlink" href="http://www.intersoftpt.com/Community/Users/handy@intersoftpt.com/"&gt;Handy Surya&lt;/a&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;I am sorry,your answer can not resolve my problem!&lt;br /&gt;&lt;/span&gt;&lt;span class="postusername"&gt;I wanna bind many datasets dynamically without other control like"dropdownlist"!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;&lt;strong&gt;Like MS's Gridview :&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;&amp;nbsp;&amp;nbsp; grid.DataSource = dataset1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;grid.DataBind();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;maybe webgrid&amp;nbsp; does not support "&lt;span class="def" sizset="1" sizcache="19"&gt;&lt;a href="app:ds:multi-" target=""&gt;multiTables-&lt;/a&gt;Binding&lt;/span&gt;",is not it??? &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;only one bind way: &lt;b&gt;&lt;i&gt;e.DataSource&lt;/i&gt;&lt;/b&gt; ?but this way can not bind &lt;strong&gt;&lt;span class="def" sizset="1" sizcache="19"&gt;&lt;a href="app:ds:multi-" target=""&gt;multiTables&lt;/a&gt;&amp;nbsp;dynamically &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;&lt;strong&gt;&lt;span class="def" sizset="1" sizcache="19"&gt;how can i do???&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;&lt;strong&gt;&lt;span class="def" sizset="1" sizcache="19"&gt;Help me please!!&lt;/span&gt;&lt;/strong&gt; 
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;&lt;/span&gt; &lt;/p&gt;</description></item><item><title>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</link><pubDate>Fri, 27 Aug 2010 11:40:31 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;You still have to use your data binding in &lt;b&gt;&lt;i&gt;InitializeDataSoruce&lt;/i&gt;&lt;/b&gt; event. &lt;br /&gt;Instead of using &lt;b&gt;&lt;i&gt;DataBind&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;e.DataSource&lt;/i&gt;&lt;/b&gt; should be working without a problem. &lt;br /&gt;I bind dynamically several tables with &lt;b&gt;&lt;i&gt;DropDownList&lt;/i&gt;&lt;/b&gt; option. It works well and I also can use &lt;b&gt;&lt;i&gt;VirtualLoad &lt;/i&gt;&lt;/b&gt;or &lt;b&gt;&lt;i&gt;export&lt;/i&gt;&lt;/b&gt;. &lt;br /&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-binding-data-dynamically/</link><pubDate>Thu, 26 Aug 2010 22:27:41 GMT</pubDate><dc:creator>qq397472251</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;p&gt;The page have a webgrid~~&lt;/p&gt;
&lt;p&gt;but I have 3 Dataset,how to : bind these Dataset to webgrid dynamically   (with the way "WebGrid1.DataBind()" ,not the way "e.DataSource = dataset1.DefaultView")   &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;I bind by DataBind()&amp;nbsp; cause export excel wrong and can not use VirtualLoadMode.and&amp;nbsp; so many questions with the way("DataBind()&amp;nbsp;"&amp;nbsp; )...&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;but how can i bind many datasouce  dynamically ????&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;such as:&lt;/p&gt;
&lt;p&gt;     protected void Button9_Click(object sender, EventArgs e)&lt;br /&gt;        {       &lt;br /&gt;            webgrid2.DataSource = myds();//second dataset&lt;br /&gt;            webgrid2.DataBind();            &lt;br /&gt;            webgrid2.RebindDataSource();       &lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;  protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {     &lt;br /&gt;            if (!IsPostBack)&lt;br /&gt;            {   &lt;br /&gt;                webgrid2.DataSource = mytb();//first dataset&lt;br /&gt;                webgrid2.DataBind();&lt;br /&gt;                webgrid2.RebindDataSource();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/p&gt;
&lt;p&gt; With this way cause wrong "Unable to communicate with server.",It seems that webgrid can not use &lt;/p&gt;
&lt;p&gt;" DataBind()"&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>