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.
Unfortunately, activation email could not send to your email. Please try again.

How to change the height of a row in the GridGroupingControl?

In the GridGroupingControl, when you change the height of a particular row, it affects the height of all the rows. You need a custom engine to resolve this problem. The custom engine is used to avoid the problem by passing the row index in the RowHeight property. In the GridModel, height of a single row is changed by using the GridEngineFactory class before invoking the InitializeComponent method.

 

By using GridModel

C#

VB

In the QueryRowHeight event, there is no engine needed to set the height of a single row because by default it supports the height change of a particular row.

 

By using QueryRowheight

C#

VB

After applying the properties, the row looks like the following screenshot

Figure 1: Changing the row height

Sample Links

C#: Changing the row height

VB: Changing the row height

Article ID: Published Date: Last Revised Date: Platform: Control:
3820 02/09/2015 02/12/2016 Windows Forms GridGroupingControl
Did you find this information helpful?
Comments
Sergei Leschinksy Apr 19, 2015
When color editors (and presumably other editors are in place) the second approach will result in heavy drawing glitches when grid rows are scrolled fast. This can be be reproduced with the code below. The first approach works fine in such scenario. public Form1() { InitializeComponent(); gridGroupingControl1.DataSource = GetDataSource().Select(item => new { Color = item }).ToList(); ; gridGroupingControl1.TableModel.QueryRowHeight += TableModel_QueryRowHeight; } void TableModel_QueryRowHeight(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e) { if (e.Index%2 == 0) { e.Size = 35; e.Handled = true; } } private IEnumerable GetDataSource() { var arr = Enum.GetValues(typeof (KnownColor)); return from KnownColor item in arr select Color.FromKnownColor(item); }
Reply
Venkatesh Sundaram [Syncfusion] Apr 21, 2015
Hi Sergei, We regret the inconvenience caused. Thanks for pointing this out. The “drawing glitches raised when grid rows are scrolled fast” can be resolved by using the UseDefaultsForFasterDrawing property. Please refer to the following code snippet. CodeSnippet[C#]: this.gridGroupingControl1.UseDefaultsForFasterDrawing = true; The KB article is modified now with the needed information. Please let us know if you have any other concern. Thanks and Regards, Venkat
Reply
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.