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

category bar double click

3 Answers 115 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Prashant
Top achievements
Rank 1
Prashant asked on 22 Mar 2014, 01:14 AM
the categories in property grid don't collapse - expand on double click .  You explicitly need to click on slider icon

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Mar 2014, 03:21 PM
Hello Prashant,

Thank you for contacting Telerik Support.

In order to expand/collapse the specific category on double click, it is necessary to subscribe to the ItemMouseDoubleClick event and revert the PropertyGridGroupItem.Expanded property:
public Form1()
{
    InitializeComponent();
     
    radPropertyGrid1.PropertySort = PropertySort.Categorized;
    radPropertyGrid1.SelectedObject = new Item(1234, "Custom title", "Description", 9834657);
 
    radPropertyGrid1.ItemMouseDoubleClick += radPropertyGrid1_ItemMouseDoubleClick;
}
 
private void radPropertyGrid1_ItemMouseDoubleClick(object sender, RadPropertyGridEventArgs e)
{
    PropertyGridGroupItem groupItem = e.Item as PropertyGridGroupItem;
    if (groupItem != null)
    {
        groupItem.Expanded = !groupItem.Expanded;
    }
}
 
public class Item
{
    [Category("Category1")]
    public int Id { get; set; }
 
    [Category("Category2")]
    public string Title { get; set; }
 
    [Category("Category2")]
    public string Description { get; set; }
 
    [Category("Category1")]
    public int BarCode { get; set; }
 
    public Item(int id, string title, string description, int barCode)
    {
        this.Id = id;
        this.Title = title;
        this.Description = description;
        this.BarCode = barCode;
    }
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Desislava
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Prashant
Top achievements
Rank 1
answered on 25 Mar 2014, 04:08 PM
Thanks Desislava,

Just wondering, Shouldn't this be a default behavior of a PropertyGrid ? 

Like there is a default context menu, to category bar,  double click to expand collapse should be a default behavior as well.
Thats how it works in Visual Studio.  For TreeView nodes., Windows Explorer etc places where things can be expand and collapsed

Image from windows explorer
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Mar 2014, 03:34 PM
Hello Prashant,

Thank you for writing back.

It is a reasonable request, indeed. I have logged it in our Feedback Portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - Feedback Item.

I have also updated your 
Telerik points.

Please do not hesitate to contact us if you have any additional questions.

Regards,
Desislava
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
PropertyGrid
Asked by
Prashant
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Prashant
Top achievements
Rank 1
Share this question
or