Click here to Skip to main content
15,077,641 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 code

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

gridView2.DataSource = dataTable;

The above code will do the magic.

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