Thanks
> Hi Goh,
>
[quoted text clipped - 13 lines]
> from your issue.
> ====================================================
Linda Liu [MSFT] - 29 Jun 2006 11:01 GMT
Hi Goh,
The DataGridView in Win forms doesn't support this scenario. We couldn't
put a DataGridView into another DataGridView.
Could you tell me why you would like to do like that? Do you want to use
two DataGridViews(e.g dgv1 and dgv2) to display the records of two
tables(e.g table1 and table2) which have a one-many relationship? If so,
you could display the records of table1 in dgv1. When you click one row in
dgv1, display the corresponding rows of table2 in dgv2.
Hope this helps.
If you have any cocerns, please don't hesitate to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================
Linda Liu [MSFT] - 04 Jul 2006 12:34 GMT
Hi Goh,
If you want to display the records of two tables which have a parent/child
relationship in a Windows form, you could use two DataGridView controls to
show the records of the two tables respectively.
The main steps of creating a master/detail form using two DataGridView
controls is listed below.
1. Create a DataSet which involves the two datatables(e.g tableParent and
tableChild) and add a DataRelation(e.g relation1) of the two datatables in
the DataSet
2. Add a instance of the DataSet (e.g dataset1) and two BindingSource
instances(e.g parentBindingSource and childBindingSource) into your form
3. Use the statements to set the DataSource and DataMember of the two
BindingSource instances:
parentBindingSource.DataSource = dataset1;
parentBindingSource.DataMember = "tableParent";
childBindingSource.DataSource = parenBindingSource;
childBindingSource.DataMember = "relation1";
For more information, you may refer to the following link:
http://msdn2.microsoft.com/en-us/library/y8c0cxey(d=ide).aspx
Hope this helps.
If you have anything unclear, please don't hesitate to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================