category bar double click

4 posts, 0 answers
  1. Prashant
    Prashant avatar
    3 posts
    Member since:
    Jan 2013

    Posted 21 Mar 2014 Link to this post

    the categories in property grid don't collapse - expand on double click .  You explicitly need to click on slider icon
  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 25 Mar 2014 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Prashant
    Prashant avatar
    3 posts
    Member since:
    Jan 2013

    Posted 25 Mar 2014 in reply to Dess Link to this post

    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
  5. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 28 Mar 2014 Link to this post

    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.

     
Back to Top