0
votes

Win forms problem.

I have the following structure

Form
-> User Control
-> -> Panel
-> -> -> GridViewControl 

When the grid view control adds a new row, the user control does not resize. I would like the user control to resize (and the panel as well ) to accommodate the increasing sized grid control.

Is there a way to configure properties to do this? Or do I need to do something programmatic?

I am thinking I may have to learn how to use delegates and notify the parent that the child control has resized so it can respond appropriately?

1

1 Answers

0
votes

Particularly I recomend you to just use scroll bars and avoid a bigger form, but whatever, you can just use the ControlAdded or the SizeChanged event of GridView or DataGridView. You really have to learn about delegates and events.

So inside the event, just check the count of itens and resize as you want.