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

[Solved] hierarchical grid double click?

1 Answer 152 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Scott Whitlow
Top achievements
Rank 1
Scott Whitlow asked on 03 Mar 2010, 11:22 PM
I have successfully created the hierarchical grid and the sub-grid. I am now needing to allow the user to double click on the sub grid that is shown. How would I go about doing this?

I am creating the subgrid like this:
GridViewTemplate oppSubGrid = new GridViewTemplate(); 
// .. other code goes here to setup columns, etc. 
gridDupes.MasterGridViewTemplate.ChildGridViewTemplates.Add(oppSubGrid); 
GridViewRelation relation = new GridViewRelation(gridDupes.MasterGridViewTemplate); 
relation.ChildTemplate = oppSubGrid; 
relation.RelationName = "ContactsOpportunities"
relation.ParentColumnNames.Add("ID"); 
relation.ChildColumnNames.Add("ContactID"); 
gridDupes.Relations.Add(relation); 


Now I just need to know how to call a function with a double click. Any ideas?

Thanks!







1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 08 Mar 2010, 08:57 AM
Hi Scott Whitlow,

Thank you for writing. You can use CellDoubleClick event to determine if a double click has occurred:

void radGridView1_CellDoubleClick(object sender, GridViewCellEventArgs e)
{
    if (e.Row.ViewTemplate == this.radGridView1.MasterGridViewTemplate.ChildGridViewTemplates[0])
    {
        MessageBox.Show("Child view was clicked");
    }
}

Let me know if you have any additional questions.

Greetings,
Martin Vasilev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Scott Whitlow
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or