Resolved PropertyGrid - How to disallow user from resizing the inside using the Splitter?

tim8w

Well-known member
Joined
Sep 8, 2020
Messages
129
Programming Experience
10+
I have balanced my PropertyGrid the way I want and I don't want the user to be able to adjust the inside using the splitter. Is there a property or some way to disallow this or to disable the splitter?

Thanks,
Tim
 
Last edited:
What's a PropertyGridView? A search yielded only an internal class used by the PropertyGrid. Either that's not the name of the control you're using or else it's a third-party control that you need to inform us about. Apart from that, what splitter?
 
What's a PropertyGridView? A search yielded only an internal class used by the PropertyGrid. Either that's not the name of the control you're using or else it's a third-party control that you need to inform us about. Apart from that, what splitter?
Sorry, I meant just PropertyGrid. And by Splitter, I mean the line/bar? between the items and the description area below. I don't want the user adjusting the size between the two.
 
@tim8w I've had two long nights working, and I'm rather tired, so and rather than guessing and giving you misleading information. I think it would be helpful to see a screenshot of what you are referring to when you say Line/Bar and PropertyGrid. Can you please do that?
 
@tim8w I've had two long nights working, and I'm rather tired, so and rather than guessing and giving you misleading information. I think it would be helpful to see a screenshot of what you are referring to when you say Line/Bar and PropertyGrid. Can you please do that?

1602098659052.png
 
He doesn't have XAML. Based on the OP's past threads he's creating a custom property editor for use with WinForms controls. E.g. something that works with the Properties pane of Visual Studio's WinForms Designer.
 
Here is the instantiation of the ProprtyGrid.SelectedObject:
C#:
DefectPropertyGrid.SelectedObject = new FirstPassYield.PropertyGridItems();


Here is the code for the PropertyGridItems:

C#:
namespace FirstPassYield
{
    internal class PropertyGridItems
    {
        private DefectCollection _Defects = new DefectCollection();

        [Editor(typeof(FirstPassYield.MyCollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
        [Category("Defects")]
        [DisplayName("Add Defects")]
        [Description("Click on the Collection elipsis (...) to add the defects for this WO Number.")]
        public DefectCollection Defects
        {
            get { return _Defects; }
            set { _Defects = value; }
        }
    }
}
 
He doesn't have XAML
Sorry! ? I've been on a bad run all day. Mixing up posts and and not reading stuff properly and what not. Think I need some sleep...

I was convinced this was for WPF. lol I'll just step away for the day.

Cya all tomorrow when I slept and am refreshed.

Edit - perhaps I'm missing something, where is the code for the splitter, and isn't that what you want to control the movement of??
 
I found this example on CodeProject by Zach Johnson called "Gain Control Over PropertyGrid’s Description Area" that uses a CustomPropertyGrid and Refelection to control the height of the Description Area. Then I just intercept the SizeChanged and set the size back to what it was.

 
Back
Top Bottom