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.

Context menu popup in child table

Thread ID:

Created:

Updated:

Platform:

Replies:

75101 Jul 11,2008 07:44 PM Jul 15,2008 07:08 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 11, 2008 07:44 PM

Hi,

I'm using a grid grouping control which is bound to tables and child tables.
When a user right clicks a cell in the child table a context menu pops up.
The pop up event calls a function that opens up a dialog box.

The dialog box takes in a parameter containing the contents of the selected cell.

Is there a way for my context menu pop up event to get the contents of the selected cell in the child table?

Thanks


Sri Rajan [Syncfusion]
Replied On July 14, 2008 02:58 AM

Hi Nikesh,

Thank you for your interest in Syncfusion products.

Please try this code to get the contents of the selected cell and let me know if this helps.

GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (cc != null)
{ Console.WriteLine(this.gridGroupingControl1.TableControl.Model[cc.RowIndex,cc.ColIndex].Text);
}


Best Regards,
Srirajan.


Administrator [Syncfusion]
Replied On July 14, 2008 02:19 PM


>Hi Nikesh,

Thank you for your interest in Syncfusion products.

Please try this code to get the contents of the selected cell and let me know if this helps.

GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (cc != null)
{ Console.WriteLine(this.gridGroupingControl1.TableControl.Model[cc.RowIndex,cc.ColIndex].Text);
}


Best Regards,
Srirajan.



Thanks for the reply,

The sample code gives me the contents on the parent table. It looks like its treating the entire child table as being in the one collapsable row of the parent table. Is there a way to get the contents of the selected cell in a child table?


Sri Rajan [Syncfusion]
Replied On July 15, 2008 07:08 AM

Hi Nikesh,

Thank you for your continued interest in Syncfusion products.

Here is the code to get the contents of a cell when you right click on the parent and child table.

void gridGroupingControl1_TableControlCellMouseDown(object sender, GridTableControlCellMouseEventArgs e)
{
if (e.Inner.MouseEventArgs.Button == MouseButtons.Right)
{
string str = e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex].Text;
if (str !="")
{
MessageBox.Show(str);
}
}
}


Please let me know if this helps.

Best Regards,
Srirajan.


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.

;