Windows Develop Bookmark and Share   
 index > Windows Forms General > RunTime Change of DataGridView Size
 

RunTime Change of DataGridView Size

Hi,

Trying to change the datagrid size for example Height during the runtime should be rather straight forward. C++ is used for the code snippet below.

MyDataGridView->Size.Height += ToBeIncreasedValue;

The problem is that despite the code being executed propery, the change of height is not neither observable by the grid or via the watch window (during the run time). There should be another property to lock/unlock the dynamic size change. Quickly looking for a presumed auto size property, the listing within the pane only indicates the AutoSizeColumnMode and RowMode, which should be related to individual columns or rows. Any idea how this could be achieved?

Regards,

Reza Bemanian

Reza Bemanian  Thursday, March 08, 2007 6:17 PM

Hi,

Apparently change of data grid view size only takes place when both the width and height are altered (or their values are utilized), as a result the following code works if such a change is desired during the runtime.

// C++

MyDataGridView->Size = System:Drawing::Size(DesiredWidth, DesiredHeight);

Regards,

Reza Bemanian

3I Control Systems

Reza Bemanian  Thursday, March 08, 2007 9:16 PM

Hi,

Apparently change of data grid view size only takes place when both the width and height are altered (or their values are utilized), as a result the following code works if such a change is desired during the runtime.

// C++

MyDataGridView->Size = System:Drawing::Size(DesiredWidth, DesiredHeight);

Regards,

Reza Bemanian

3I Control Systems

Reza Bemanian  Thursday, March 08, 2007 9:16 PM

You can use google to search for other answers

Custom Search

More Threads

• ComboBox OnMeasureItem doesn't influence height of DropDownList?
• How to use IXMLDocument in C#?
• Whidbey and WinForms VisualStyleRenderer
• Tabbing order not working
• Display Live Video inside a form
• Graphics.MeasureString is not accurate
• How to re-size w/ flow or table layouts
• Copying Datagridview Contents
• Extending NumericUpDown Control
• Difference between Control & Component