Hide margin and set fixed column size for wxPropertyGrid

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Ronald
Experienced Solver
Experienced Solver
Posts: 81
Joined: Mon Mar 05, 2018 4:17 am

Hide margin and set fixed column size for wxPropertyGrid

Post by Ronald » Mon Jan 21, 2019 3:41 pm

Code: Select all

wxPropertyGrid * pPropGrid_Evaluate = new wxPropertyGrid(this, wxID_ANY);
pPropGrid_Evaluate->SetMarginColour(*wxRED);
pPropGrid_Evaluate->EnableCategories(false);
//pPropGrid_Evaluate->CenterSplitter(true);
wxStringProperty * p1 = new wxStringProperty(wxT("ID"), wxPG_LABEL);
p1->SetValue(wxT("aaa"));
pPropGrid_Evaluate->Append(p1);
pPropGrid_Evaluate->Append(new wxStringProperty(wxT("Name"), wxPG_LABEL));
pPropGrid_Evaluate->FitColumns();
Capture.PNG
Capture.PNG (778 Bytes) Viewed 87 times
  • How to hide the margin on the left (red portion in the image above) when no hierarchy there?
  • How to set fixed column size for some column?
    In the code above, FitColumns will fit the second the line correctly, the first column size changes proportionally according to the second
  • wxWidgets 3.1.2
  • Windows 10
  • VS2017

Post Reply