Hi, All, posted a thread earlier regarding nested tables on .net data grid, guess, the simple goal that I am looking for is: for a .net datagrid on a win form app, how can I embed a child datagrid for each data row - so I can click one of the parent row column (e.g. first column of the parent data row and launch the embed child datagrid that loads details child lelev information thanks.
mark

how to embed child datagrid from its parent
Edward Rose
mark
Ekta
I have this panel style with a little thumb tack in one column. When you press it, I show a panel, now in the panel could be any control, including a datagrid. If you do your relations right, then it will show the child records in that datagrid.
Yea you still have something to click on, but it's alot better then the little plus sign. And you can still see the orginal datagrid in the background.
Plus since it's a panel I can show text box controls to edit that column and it makes things so nice.
Dick Kuo
"
amiga
take a look at the following link:
http://www.syncfusion.com/Products/grid/features/grid_feat_3.aspx
and
http://www.syncfusion.com/Products/grid/features/grid_feat_2.aspx
to implement this in datagrid on windows form application is far complicated than just binding related table to the grid, doing this on the web form is bit simple since the web form out is html - trick can be done in a extendable html block, and I AM LOOKING for a windows form based solution for .net datagrid that can function similar as above Syncfusion product.
mark
Adithya reddy
I don't think you'll ever get the intrinsic datagrid do embedded grids like that; maybe if you implement a custom version of the datagrid and override a lot of code... i'd really have to think about that, one but you might be able to make your own.
But short of creating your own customized DataGrid, the best you could do would be to create an onclick event for the grid that rebinds it to the related table. You could use a context menu (or button, whatever) to navigate back. But you're still only going to see one grid at a time.
Squall Leonhart
EXAMPLE:
I have 2 tables, [PressData] and [PartData]. [PressData] has a unique ID Field called [Number]. The [PartData] table has all the parts for a given press. The [PartData] table has a field called [Press] that is the [Number] from the [PressData] table. I want my DataGrid to display all the Press records and I want to expand an press record to show all the parts in that press. I do the following:
Add DataAdapter1 to the project. Configure it to select all fields from [PressData].
Add DataAdapter2 to the project to select all fields from [PartData]. Use the DataAdapter to generate DataSet1 (be sure to select both tables in the dialog when creating the dataset).
Now your DataSet has both tables in it. You just need to execute the following code when your form loads:
DataAdapter1.Fill(DataSet1)
DataAdapter2.Fill(DataSet1)
DataSet1.Relations.Add(DataSet1.Tables("PressData").Columns("Number"), DataSet1.Tables("PartData").Columns("Press"))
DataGrid1.SetDataBinding(DataSet1, "PressData")
Thats it!!
turnkey
mark
>>>>
Octavio
And thanks for the FYI, but had I posted the code showing a direct bind to the Table, it would not have been as clear how the bind to the relationship was actually taking place. Shortcut code is not good example code.
This is still an interesting request. I would be interested in ideas about implementing a custom DataGrid to give it the functionality you are looking for.
Gregory Dye
Have you found a solution Mark
Bhanu_Prakash
you could make something like a datagrid-datagridcolumn that show related data as you klik on it .
Good luck
Remco
James Lapalme