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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

parent gdbg record count

Thread ID:

Created:

Updated:

Platform:

Replies:

92385 Jan 12,2010 05:35 AM UTC Jan 12,2010 03:00 PM UTC WinForms 2
loading
Tags: GridControl
Keith Aubin
Asked On January 12, 2010 05:35 AM UTC

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 02:25 PM UTC

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 03:00 PM UTC

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.

Warning Icon 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.Close Icon

;