0

I am currently using DesignSurface to create a custom designer. I want to enable dragging the column widths of a DataGridView on the designer page and record the changes, similar to how it works at runtime. How can I achieve this?

I used IDesignerHost to create a root component for the designer. I created the DataGridView using the approach:

IComponent newComp = host.CreateComponent(typeof(TControl));

Now I want to enable dragging column widths on the designer page.

1 Answer 1

1

Enable the AllowUserToResizeColumns property. Normally, to allow resizing columns in a DataGridView by dragging, you need to set:

dataGridView.AllowUserToResizeColumns = true;

This property must also be enabled when working inside the designer, otherwise the user will not be able to drag and resize the columns on the design surface

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.