K
Karel
Hi,
I'm having some problems with my datagrid. Its datasource is a
dataset, that has a datarelation:
objconnection = New OleDbConnection("provider=SQLOLEDB;" ..)
objconnection.Open()
objDataSet = New DataSet
objdataAdapt1 = New OleDbDataAdapter("select * from person",
objconnection)
objdataAdapt2 = New OleDbDataAdapter("select * from Address",
objconnection)
objdataAdapt1.Fill(objDataSet, "Person")
objdataAdapt2.Fill(objDataSet, "Address")
col1 = objDataSet.Tables("Person").Columns("p_person")
col2 = objDataSet.Tables("Address").Columns("p_person")
Relation = New DataRelation("Address", col1, col2)
objDataSet.Relations.Add(Relation)
objconnection.Close()
Datagrid.DataSource = objDataSet
I can run it fine, and it looks like in the manual.
But it's an ugly looking thing , with just the +sign and the 2 table
names (in this case Person and Address)...
What I would like is parentrows, with its childrows, something like
this, with expandable parentrows:
_____________________________________________________
+ Drinks
_____________________________________________________
Water
_____________________________________________________
Orange juice
_____________________________________________________
Cola
_____________________________________________________
+ Snacks
_____________________________________________________
Mars
_____________________________________________________
Snickers
_____________________________________________________
Chips
_____________________________________________________
Actually the looks of a treeview in a datagrid...
Does anyone have any idea where to find some information on this, or
how to accomplish this?
Thanks in advance!
Karel
I'm having some problems with my datagrid. Its datasource is a
dataset, that has a datarelation:
objconnection = New OleDbConnection("provider=SQLOLEDB;" ..)
objconnection.Open()
objDataSet = New DataSet
objdataAdapt1 = New OleDbDataAdapter("select * from person",
objconnection)
objdataAdapt2 = New OleDbDataAdapter("select * from Address",
objconnection)
objdataAdapt1.Fill(objDataSet, "Person")
objdataAdapt2.Fill(objDataSet, "Address")
col1 = objDataSet.Tables("Person").Columns("p_person")
col2 = objDataSet.Tables("Address").Columns("p_person")
Relation = New DataRelation("Address", col1, col2)
objDataSet.Relations.Add(Relation)
objconnection.Close()
Datagrid.DataSource = objDataSet
I can run it fine, and it looks like in the manual.
But it's an ugly looking thing , with just the +sign and the 2 table
names (in this case Person and Address)...
What I would like is parentrows, with its childrows, something like
this, with expandable parentrows:
_____________________________________________________
+ Drinks
_____________________________________________________
Water
_____________________________________________________
Orange juice
_____________________________________________________
Cola
_____________________________________________________
+ Snacks
_____________________________________________________
Mars
_____________________________________________________
Snickers
_____________________________________________________
Chips
_____________________________________________________
Actually the looks of a treeview in a datagrid...
Does anyone have any idea where to find some information on this, or
how to accomplish this?
Thanks in advance!
Karel