We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change default row height after one row height is changed

I want to change the grid default row height after one row height is changed. Where to implement this feature? In the event RowHeightsChanged? Please provide some code. Thanks.

2 Replies

ST stanleyj Syncfusion Team January 10, 2006 07:13 AM UTC

Hi Hui, One way to acheive this is to use the QueryRowHeight handler and set e.Size to the last adjusted height that can be obtained from the ResizingRows handler. int height; height = gridControl1.DefaultRowHeight; private void gridControl1_ResizingRows(object sender, Syncfusion.Windows.Forms.Grid.GridResizingRowsEventArgs e) { if(e.Reason == GridResizeCellsReason.MouseUp) height = e.Height; this.gridControl1.Invalidate(); } private void gridControl1_QueryRowHeight(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e) { e.Size = height; e.Handled = true; } Best regards, Stanley


HZ Hui Zhong January 10, 2006 03:12 PM UTC

Thanks. >Hi Hui, > >One way to acheive this is to use the QueryRowHeight handler and set e.Size to the last adjusted height that can be obtained from the ResizingRows handler. > > int height; > height = gridControl1.DefaultRowHeight; > > private void gridControl1_ResizingRows(object sender, Syncfusion.Windows.Forms.Grid.GridResizingRowsEventArgs e) > { > if(e.Reason == GridResizeCellsReason.MouseUp) > height = e.Height; > this.gridControl1.Invalidate(); > } > > > private void gridControl1_QueryRowHeight(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e) > { > e.Size = height; > e.Handled = true; > } > >Best regards, >Stanley

Loader.
Live Chat Icon For mobile
Up arrow icon