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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

2nd level and FrozenColumn

Thread ID:





80622 Apr 17,2009 01:29 PM UTC Apr 28,2009 08:07 PM UTC WinForms 4
Tags: Grouping
Stephane _
Asked On April 17, 2009 01:29 PM UTC

If I add this
Me.gridGroupingControl1.TableModel.Cols.FrozenCount = 2
Me.gridGroupingControl1.TableModel.Cols.HeaderCount = 2

To the grouping sample


I get a weird behavior where half of the second level group title name is moving with the scrollbar.
Do you know who I can fix this?

Jisha Joy [Syncfusion]
Replied On April 20, 2009 08:54 AM UTC

Hi Stephane,

Please try increasing the column width of first column to see if this helps.

this.gridGroupingControl1.TableDescriptor.Columns[0].Width =225;

Please let me know if this helps.


Stephane _
Replied On April 20, 2009 01:59 PM UTC

It works but the first column is awkwardly large. Is this the only option?

Jisha Joy [Syncfusion]
Replied On April 21, 2009 04:45 AM UTC

Hi Stephane,

You need to handle the TableControlDrawCell event and draw the GridCaption cell text using DrawString method. Please see the code:

// In form Load


this.gridGroupingControl1.TableControl.HScrollPixelPosChanged += new GridScrollPositionChangedEventHandler(HScrollPixelPosChanged);
this.gridGroupingControl1.TableControlDrawCell += new GridTableControlDrawCellEventHandler(TableControlDrawCell);

// event handlers

private void TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;

if (style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
e.Inner.Cancel = true;
string s = e.Inner.Style.Text;
e.Inner.Style.Text = string.Empty;

Rectangle rect = e.Inner.Bounds;
rect.Location = new Point(0, rect.Y);

e.Inner.Renderer.Draw(e.Inner.Graphics, e.Inner.Bounds, e.Inner.RowIndex, e.Inner.ColIndex, e.Inner.Style);
e.Inner.Graphics.DrawString(s, e.Inner.Style.GdipFont, new SolidBrush(e.Inner.Style.TextColor), rect);

e.Inner.Style.Text = s;

private void HScrollPixelPosChanged(object sender, GridScrollPositionChangedEventArgs e)
GridTableControl tc = sender as GridTableControl;

Please let me know if this helps.


Stephane _
Replied On April 28, 2009 08:07 PM UTC



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon