473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Nested Tables in Datagrid???

Hi there...

I am trying to display both parent and child details in my datagrid at the
same time but i cannot seem to do it. It's either one or the other, if
anyone has any suggestions on how i can do this please let me know.

My current code to establish the relationship and display the datagrid is as
follows...

GLDs.Clear() ;
GLConnection.ConnectionString = AppMain.CompanyConnectionPath ;
GLConnection.Open() ;
//Select commands for both adapters
SelectCommand1.CommandText = "SELECT * FROM " + pPostTable ;
SelectCommand1.Connection = GLConnection ;
SelectCommand2.CommandText = "SELECT * FROM " + pSourceTable ;
SelectCommand2.Connection = GLConnection ;
//Loading Post table details
GLAdapter1.SelectCommand = SelectCommand1 ;
GLAdapter1.MissingSchemaAction = MissingSchemaAction.AddWithKey ;
GLAdapter1.Fill(GLDs, pPostTable) ;
//Loading Source table details
GLAdapter2.SelectCommand = SelectCommand2 ;
GLAdapter2.MissingSchemaAction = MissingSchemaAction.AddWithKey ;
GLAdapter2.Fill(GLDs, pSourceTable) ;
//Setting the table relationship
GLDs.Relations.Add("View Batch Transactions",
GLDs.Tables[pPostTable].Columns["GLBatchID"],
GLDs.Tables[pSourceTable].Columns["GLBatchID"]) ;
//Adding some custom table styles
AddCustomDataTableStyle1() ;
AddCustomDataTableStyle2() ;
//Updating the Datagrids details
dgViewTrans.SetDataBinding(GLDs, pPostTable) ;

Regards

Darryn
Nov 16 '05 #1
1 2040
Darryn,

You can't do this. The datagrid that comes with .NET allows you to
drill down, but not open up child data grids in the same space. You will
have to get a third party control that will do this.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Darryn Ross" <da****@datawave.com.au> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi there...

I am trying to display both parent and child details in my datagrid at the
same time but i cannot seem to do it. It's either one or the other, if
anyone has any suggestions on how i can do this please let me know.

My current code to establish the relationship and display the datagrid is
as
follows...

GLDs.Clear() ;
GLConnection.ConnectionString = AppMain.CompanyConnectionPath ;
GLConnection.Open() ;
//Select commands for both adapters
SelectCommand1.CommandText = "SELECT * FROM " + pPostTable ;
SelectCommand1.Connection = GLConnection ;
SelectCommand2.CommandText = "SELECT * FROM " + pSourceTable ;
SelectCommand2.Connection = GLConnection ;
//Loading Post table details
GLAdapter1.SelectCommand = SelectCommand1 ;
GLAdapter1.MissingSchemaAction = MissingSchemaAction.AddWithKey ;
GLAdapter1.Fill(GLDs, pPostTable) ;
//Loading Source table details
GLAdapter2.SelectCommand = SelectCommand2 ;
GLAdapter2.MissingSchemaAction = MissingSchemaAction.AddWithKey ;
GLAdapter2.Fill(GLDs, pSourceTable) ;
//Setting the table relationship
GLDs.Relations.Add("View Batch Transactions",
GLDs.Tables[pPostTable].Columns["GLBatchID"],
GLDs.Tables[pSourceTable].Columns["GLBatchID"]) ;
//Adding some custom table styles
AddCustomDataTableStyle1() ;
AddCustomDataTableStyle2() ;
//Updating the Datagrids details
dgViewTrans.SetDataBinding(GLDs, pPostTable) ;

Regards

Darryn

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child...
1
by: SR | last post by:
Plz Help I have a dataset which has tables area,goals,objectives,tactics each area can have many goals,each goal can have many objectives,each objectives can have many tactics they are...
0
by: Chad Folden | last post by:
I can't figure out how to use the EditCommand for the nested datagrid .. HELP PLEASE ;-) It works perfectly for the parent datagrid, but will not display, even though the EditCommand event is...
2
by: Stephen Miller | last post by:
I am using the OnItemDataBound event of Repeater control to nest a DataGrid within the Repeater. When I attempt to bind to the DataGrid using the DataSource method I get the error message "Object...
4
by: Steve Klett | last post by:
(I posted this in ADO group, but I think this group will be better) Hi- I need to develop an FAQ section for our website. We would like to break up the FAQ by products, then categories with...
2
by: Josh | last post by:
Hi Guys, I have been stuck on this problem for several days now, i have a set of nested datagrids. Inside the second datagrid i have a dropdown list, a textbox and a label. I want the textbox...
5
by: BMeyer | last post by:
I have been losing my mind trying to parse an XML document (with nested child elements, not all of which appear in each parent node) into a DataGrid object. What I want to do is "flatten" the XML...
0
by: rupalirane07 | last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error: NullReferenceException error Any...
0
by: KA NMC | last post by:
I have One Datagrid with a dataset that calls two tables - the First table is the table the user will be editing - which edited on the grid or in a textbox - as the user edits the grid - that info is...
2
by: Me LK | last post by:
I have a set of drop downs nested in a datagrid. Each drop down is a size or color for an item. Each row of the grid has a button which leads to a cart. When a user selects something from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.