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.
Syncfusion Feedback

Stacked headers instide stacked header

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi,

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.

thanks.



StackedHeader_bb9ef31.rar

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.

Regards,
Jisha



GGC_31929137.zip

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.

Thanks

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

Hi,

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

GridStackedHeaderDescriptor header1 = new GridStackedHeaderDescriptor("No");
header1.VisibleColumns.Add("SNo");


header1.VisibleColumns.Add("Department");
header1.VisibleColumns.Add("Location");

GridStackedHeaderRowDescriptor row1 = new GridStackedHeaderRowDescriptor("Details");
row1.Headers.Add(header1);


Please let me know if this helps.

Regards,
Jisha

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

Hi,


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:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGC_BoundImg-309510967.zip

Please let me know if this helps.

Regards,
Jisha

CONFIRMATION

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.

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

;