Click here to Skip to main content
15,920,801 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my web application me add a gridview GridView1 and add another gridview GridView2,and label to GridView1s template field .i can bind data in datatable to label using the code Eval("Name").Then i want to bind another datatable to GridView2.By using Sql data source control i can bind the data to datagrid view but i want to bind data using c#.net code
Posted

GridView2 is a template field inside the Gridview1.So i cant bind data using the code
MIDL
gridView2.DataSource = dataTable;
gridView2.DataBind();
 
Share this answer
 
Comments
Raj.rcr 16-Mar-11 1:27am    
Posted the same solution as above.. But, correct...
I assume you have the DataTable now.

C#
gridView2.DataSource = dataTable;
gridView2.DataBind();


The above code will do the magic.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900