We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

parent gdbg record count

Thread ID:

Created:

Updated:

Platform:

Replies:

92385 Jan 12,2010 12:35 AM Jan 12,2010 10:00 AM Windows Forms 2
loading
Tags: GridControl
Keith Aubin
Asked On January 12, 2010 12:35 AM

Hello,

This is likely a simple question, but I am stuck at the moment.

I have two GridDataBoundGrids, each with the same dataset as its datasource.

The dataset has two tables in it, MyParentTable and MyChildTable.

There is a FK relation between these tables called FK_ParentChild.

The datamembers on the GridDataBoundGrids 1 and 2 are MyParentTable and MyParentTable.FK_ParentChild, respectively.

Therefore, row selections in GDBG1 filter the rows shown in GDBG2.

My question is, from a GDBG2 event, such as Enter, how do I retrieve the number of rows shown in GDBG1? The trick is my form is created dynamically from metadata stored in a database, so I don't know beforehand how the grids are linked.

Thanks,
Keith

Lingaraj S [Syncfusion]
Replied On January 12, 2010 09:25 AM

Hi Keith,

Thank you for your interest in Syncfusion products.

Please refer the below forum thread, similar kind of behavior has been discussed.
http://www.syncfusion.com/support/forums/grid-windows/89652/Re--issue-in-GridQueryCellInfoEventHandler

Please let me know if it helps.

Regards,
Lingaraj S.

Lingaraj S [Syncfusion]
Replied On January 12, 2010 10:00 AM

Hi Keith,

Sorry, please ignore the previous update.

Try using using below way in GDBG2 events to achieve your requirement as shown below.

this.gridDataBoundGrid1.CurrentCellKeyDown += new KeyEventHandler(gridDataBoundGrid1_CurrentCellKeyDown);
void gridDataBoundGrid1_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
Control grid2=sender as Control;
if (e.KeyCode == Keys.Enter)
{
Form f = FindFormHelper.FindForm((GridDataBoundGrid)sender);
foreach (Control con in f.Controls)
{
GridDataBoundGrid grid1 = con as GridDataBoundGrid;
if (grid1!=null)
{
if (con!=grid2)
{
MessageBox.Show(grid1.Model.ColCount.ToString());
}
}
}
}
}



Please let me know if you have any queries.

Regards,
Lingaraj S.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;