0

i used PropertyGrid control to display properties on gridview. i have taken an reference of this link http://www.c-sharpcorner.com/article/using-property-grid-in-c-sharp/ which is showing like this enter image description here enter image description here

But i need checkbox just before the property name shown in red mark on check/uncheck for any property i need to build expression.

Community
  • 1
  • 1
ND's
  • 2,155
  • 6
  • 38
  • 59
  • 3
    `PropertyGrid` is not suitable for that requirement. You need to create the expression builder yourself. Maybe a `DataGridView` control is a better option. You also can create a custom composite control to satisfy the requirement. – Reza Aghaei Jan 31 '18 at 06:41

2 Answers2

0

I recommend reading this: How do I change boolean properties with one click in PropertyGrid.

It extends the PropertyGrid control and defines its checkbox controls using UITypeEditor.

WeiJun
  • 51
  • 10
0

As Reza mentioned, your choice of control does not appear optimal. You should probably create a form with TextBox, CheckBox, ComboBox etc. Or make use of DataGridView if your display is catering for multiple records at same time.

If you most definitely want to customize PropertyGrid, here is my another answer which might help you start with.

Linked answer:

You can make use of TrackBar. Note that PropertyGrid by default does not allow you to add controls like these to it. So, you will need to do some work here. You will need to create a class that inherits from System.Drawing.Design.UITypeEditor. Next you will have to set the editor attribute for the property that has to display track bar as control. Note that unless you do custom paint, it will be shown as modal dialog or as dropdown editor.

danish
  • 5,550
  • 2
  • 25
  • 28