How to change the height property of panel dynamically
-
i have placed a data grid inside a panel if the data grid have the record the panel will expand and if the data grid don't have a data then the height of the panel will be zero. how i change a height property of a Panel according to the click of the user how to set the height property and scroll property at run time
KnightGuy
-
i have placed a data grid inside a panel if the data grid have the record the panel will expand and if the data grid don't have a data then the height of the panel will be zero. how i change a height property of a Panel according to the click of the user how to set the height property and scroll property at run time
KnightGuy
From what I understand you are trying to do, you are trying to set the size of your panel to be equal to that of the contents inside of it? You can loop for that int i = 0; int max = panel1.controls.items.count -1; panel1.height = 0; while i <= max { panel1.size += panel1.controls.items.i.height; i++; } 'edit you can suspend your layout so you don't see it resize