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
SR
Sri Rajan
Syncfusion Team
July 14, 2008 06:58 AM UTC
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.
AD
Administrator
Syncfusion Team
July 14, 2008 06:19 PM UTC
>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?
SR
Sri Rajan
Syncfusion Team
July 15, 2008 11:08 AM UTC
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.