Setting Grid Visible cells

Hi I want to set minimum of 2-4 rows in grid to be visible always. The problem i am facing is i had the grid anchor property to fill and when i resize manually the rows get resized for the grid is there any way to restrict to display the minimum rows Regards Ajay

1 Reply

AD Administrator Syncfusion Team July 18, 2006 12:45 AM UTC

Since you are using Dock.Fill, then I think you will have to try to avoid the grid''s parent control from sizing too small. Exactly how you go about this depends upon the parent. If it is a form, you can try setting a property. int minGridHeight = this.gridGroupingControl1.TableModel.RowHeights.GetTotal(0, 5) + 2 * SystemInformation.FrameBorderSize.Height + SystemInformation.CaptionHeight; this.MinimumSize = new Size(this.MinimumSize.Width, minGridHeight); If it is somethelse, you might try hadling a SizeChanged event on the parent and reset the size there. (But this will likely cause flickers as the size gets reset.) protected override void OnSizeChanged(EventArgs e) { int minGridHeight = this.gridGroupingControl1.TableModel.RowHeights.GetTotal(0, 5) + 2; if (this.ClientSize.Height < minGridHeight) { this.ClientSize = new Size(this.ClientSize.Width, minGridHeight); } base.OnSizeChanged(e); }

Loader.
Up arrow icon