Double Click on property name

3 posts, 0 answers
  1. rodzyy
    rodzyy avatar
    2 posts
    Member since:
    Jul 2011

    Posted 18 Jul 2011 Link to this post

    I want to double click on property name to focused in value of property.
    Is it possible?
  2. Bill
    Bill avatar
    5 posts
    Member since:
    Mar 2012

    Posted 09 Oct 2012 Link to this post

    Any updates on this? Will this be a template override? 

    Also, I do not want to "tab stop" on the label of the property grid definitions. Just the editor templates. I was trying to edit the PropertyGridField style and set Focusable to false but it doesn't appear to have any effect. any ideas? (Note: I also tried the IsTabStop property)


  3. DevCraft banner
  4. Maya
    Maya avatar
    4062 posts

    Posted 10 Oct 2012 Link to this post

    Hi Bill,

    You need to find the property field corresponding to the label you double-clicked on and focus its editing element. For example:

    void propertyGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
                var fields = this.propertyGrid.ChildrenOfType<PropertyGridField>();
                var clickedElement = e.OriginalSource as FrameworkElement;
                if (clickedElement != null)
                    var propertyDefinition = clickedElement.DataContext as PropertyDefinition;
                    var currentField = fields.Where(f => f.DataContext.Equals(propertyDefinition)).FirstOrDefault();
                    if (currentField != null)
                        var editingElement = currentField.ChildrenOfType<TextBox>().FirstOrDefault();
    Let me know whether this approach meets your requirements.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top