Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Nested Grid Problem...

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Nested Grid Problem...
Link Posted: 17-Jan-2008 08:59
I have managed to get nested grid kind of working (please see attached project), however if I try to add more than one item onto the nested grid it does not show the second one correctly e.g. it does not show the dotted lines between the items (see attached image)

Please could you review the project and let me know what I have done wrong, I have been trying to solve this for some time now and your help would be really appreciated.

Note: Change the connStr variable in the DBAccess.vb script to suit your server name.

Thank you for your help

Simon
Link Posted: 17-Jan-2008 14:58
Simon,

From your form code it looks like you're using colID as parent and child key simultaneously.
I modified your code and database to make it take data from the same datatable and use colID and colUniqueID to provide relationship.

So now it looks ok.
Link Posted: 17-Jan-2008 22:06
EvgenyT,

Is there anychance that you can repost the modified code so that I can see what you have done.

Thank you for your help

Simon
Link Posted: 18-Jan-2008 00:54
Simon,
I modified your code:

Dim parentColumn As DataColumn = myDS.Tables("tblInfo").Columns("colUniqueID")
Dim childColumn As DataColumn = myDS.Tables("tblInfo").Columns("colID")
Dim relation As DataRelation = New System.Data.DataRelation("NumbersConnections", parentColumn, childColumn)


And made colUniqueID and colID of the same integer type.
Link Posted: 18-Jan-2008 01:34
EvgenyT,

Thank you for the info, however I am still strugling to get the code correct, please could you confirm that this is the correct code?


Dim myDA As New OleDb.OleDbDataAdapter("spQryParentComments", myDB.myConn)
            myDA.TableMappings.Add("Table", "tblInfo")
            myDA.SelectCommand.CommandType = CommandType.StoredProcedure
            Dim myDS As New DataSet("Original")
            myDA.Fill(myDS)

            Dim myChildDA As New OleDb.OleDbDataAdapter("spQryChildComments", myDB.myConn)
            myChildDA.TableMappings.Add("Table", "tblInfo")
            myChildDA.SelectCommand.CommandType = CommandType.StoredProcedure
            myChildDA.Fill(myDS)

            Dim parentColumn As DataColumn = myDS.Tables("tblInfo").Columns("colUniqueID")
            Dim childColumn As DataColumn = myDS.Tables("tblInfo").Columns("colID")
            Dim relation As DataRelation = New System.Data.DataRelation("NumbersConnections", parentColumn, childColumn)

            myDS.Relations.Add(relation)

            myDB.DisConnect()

            Me.FlyGrid2.Rows.Items.Clear()
            Me.FlyGrid2.Rows.DataSource = myDS
            Me.FlyGrid2.Rows.DataMember = "tblInfo"
            Me.FlyGrid2.Focus()


Sorry to be a pain.

Thanks in advance

Simon
Link Posted: 18-Jan-2008 13:06
Simon,

The difference is that I'm not using stored procedures to get data.
Just TableDirect.
Link Posted: 19-Jan-2008 02:54
is there anyway that u could help  me to solve the problem using stored procedures as this is really causing problems for me.

thanks in advance

simon
Link Posted: 20-Jan-2008 00:45
Simon, yes.

But could you please also clarify your requirements.
Do you need a nested grids (as it looks like from topic title) or hierarchical (treeview-like) grid?
Link Posted: 20-Jan-2008 08:42
Basically I want to acheive the same look as in your Tree/ListView replacement example provided with the flygrid software.

Not quite sure if this is a treeview or hierarchy column field.

Any help would be really appreshiated

Thanks in advance

Simon
Link Posted: 21-Jan-2008 00:21
Simon,
Ok, I'll try to prepare a demo, which uses your stored procedures and data and hierarchycolumn.