Link to home
Create AccountLog in
Avatar of ross13
ross13Flag for United Kingdom of Great Britain and Northern Ireland

asked on

vb.net dataset / datagrid

I have a dataset that i need to bind to a datagrid. I have two datatables in the dataset a header and a detail table.
What i want to try and do is to display the data from the header in the datagrid but have the + sign next to that item.
When the user selects this they are able to see the detail entry.

Regards,


Ross
Avatar of Asim Nazir
Asim Nazir
Flag of Pakistan image

Bind with DataSet.Tables[0] or DataSet.Tables[1] whichever is the header one. THis will show Header data only - without + sign.
ASKER CERTIFIED SOLUTION
Avatar of Asim Nazir
Asim Nazir
Flag of Pakistan image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of ross13

ASKER

I have tried adding a relationship but i still dont get the + sign

        Dim data_relation As New DataRelation("Parent_Child", dsErrors.Tables("UD100").Columns("KEY1"), _
                 dsErrors.Tables("UD100A").Columns("KEY1"))
        dsErrors.Relations.Add(data_relation)

Me.DataGridView1.DataSource = dsErrors.Tables("UD100")
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.