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

Stacked headers instide stacked header

Thread ID:





95362 Jul 4,2010 12:07 PM UTC Jul 19,2010 09:44 AM UTC WinForms 5
Tags: GridControl
Ruslan Gasanbekov
Asked On July 4, 2010 12:07 PM UTC


I got grid with couple of coulms which contains stacked headers.
I would like to add one more stacked header on top of them (the marked one in the picture) which should contain 3 inner columns:
right one for changing the plane icon
center for changing another type of icon
left for showing or hiding a check box.

for that I think I need 3 stacked header inside the top stacked header or 3 cells.
any idea how to achive that.



Jisha Joy [Syncfusion]
Replied On July 5, 2010 07:13 AM UTC

Hi Ruslan,

You could achieve the desired behavior by adding grouping the required column to the stacked row descriptor. See the attached samppe for implementation.



Ruslan Gasanbekov
Replied On July 6, 2010 07:14 AM UTC

This is not what I want.
I would like to show 3 columns in one stacked header which above one column, in order to be able to display two icons and one checkbox in one column stacked header.


Jisha Joy [Syncfusion]
Replied On July 8, 2010 12:37 PM UTC


Please refer the following code that allows us to group three columns under the same stacked header:

GridStackedHeaderDescriptor header1 = new GridStackedHeaderDescriptor("No");


GridStackedHeaderRowDescriptor row1 = new GridStackedHeaderRowDescriptor("Details");

Please let me know if this helps.


Ruslan Gasanbekov
Replied On July 13, 2010 11:10 AM UTC


How can I add two dynamic icons(which can be changed in runtime)
to StackedHeaderCell which contains a checkbox.

The StackedHeaderCell is above one column.

Jisha Joy [Syncfusion]
Replied On July 19, 2010 09:44 AM UTC

Hi Ruslan,

You could achieve the desired behavior by custom drawing your image in the TableControlCellDrawn event handler of the GridGroupingControl. In this event you could check for the specified columheader and stack header and set the image. See the code:

private void gridGroupingControl1_TableControlCellDrawn(object sender, GridTableControlDrawCellEventArgs e)
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
//for column header
if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell &&
style.TableCellIdentity.Column != null && style.TableCellIdentity.Column.Name == "Location")
GridStaticCellRenderer.DrawImage(e.Inner.Graphics, this.imageList1,1, e.Inner.Bounds, false);

// for the stacked header
if (style.TableCellIdentity.TableCellType == GridTableCellType.StackedHeaderCell && style.TableCellIdentity.ColIndex==1)
GridStaticCellRenderer.DrawImage(e.Inner.Graphics, this.imageList1, 0, e.Inner.Bounds, false);


Sample for your reference:


Please let me know if this helps.



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