|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataGridViewHi,
As we all know that Asp.net allo DataGridView inside another DataGridView. How can we implement this kind of thing in Win Form. Thanks. Goh Hi Goh,
Thank you for posting. This is a quick note to let you know that I am performing research on this issue and will get back to you as soon as possible. I appreciate your patience. 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. ==================================================== Thanks
Show quote "Linda Liu [MSFT]" <v-l***@online.microsoft.com> wrote in message news:$ZxdovcmGHA.5184@TK2MSFTNGXA01.phx.gbl... > Hi Goh, > > Thank you for posting. > > This is a quick note to let you know that I am performing research on this > issue and will get back to you as soon as possible. I appreciate your > patience. > > > > 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. > ==================================================== > 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. ==================================================== 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. ==================================================== |
|||||||||||||||||||||||