This is a migrated thread and some comments may be shown as answers.

Context Menu on Child Row

3 Answers 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 12 Apr 2011, 11:07 AM
Hello,

Can anybody point me in the right direction on how to implement or check to see if a context menu right click is being clicked on a Parent Row or a Child row of a hierarchy grid?

Many thanks

Terry

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 12 Apr 2011, 11:19 AM
Hi Terry,

When the context menu opens, you can inspect the current row's view template to see if it is the MasterTemplate or one of your child templates.
E.g.
private void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
    if (this.radGridView1.CurrentRow.ViewInfo.ViewTemplate == this.radGridView1.MasterTemplate)
    {
        MessageBox.Show("Showing context menu for top level");
    }
    else
    {
        MessageBox.Show("Showing context menu for child level");
    }
}

Hope that helps
Richard
0
Terry
Top achievements
Rank 1
answered on 12 Apr 2011, 11:46 AM
Many thanks again Richard.

As you can see, I am clearly still trying to find my way around the vast array of possibilities with this grid. Having used Janus in the past, I'm completely bowled over by the community support and speed at which answers are forthcoming.

Regards

Terry
0
Richard Slade
Top achievements
Rank 2
answered on 12 Apr 2011, 11:48 AM
No problem Terry. Glad that this helped. Just let us know if there's anything else.
Regards,
Richard
Tags
GridView
Asked by
Terry
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Terry
Top achievements
Rank 1
Share this question
or