how to :binding data dynamically

7 replies. Last post: August 31, 2010 3:19 AM by Frank Bruce
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Frank BruceMember

The page have a webgrid~~

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")  

I bind by DataBind()  cause export excel wrong and can not use VirtualLoadMode.and  so many questions with the way("DataBind() "  )...

but how can i bind many datasouce  dynamically ????

 

such as:

     protected void Button9_Click(object sender, EventArgs e)
        {       
            webgrid2.DataSource = myds();//second dataset
            webgrid2.DataBind();           
            webgrid2.RebindDataSource();       

        }
  protected void Page_Load(object sender, EventArgs e)
        {     
            if (!IsPostBack)
            {   
                webgrid2.DataSource = mytb();//first dataset
                webgrid2.DataBind();
                webgrid2.RebindDataSource();
            }
        }

 With this way cause wrong "Unable to communicate with server.",It seems that webgrid can not use

" DataBind()"

 

All times are GMT -5. The time now is 7:18 PM.
Previous Next