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

GridDataStackedHeaderColumn CellItemTemplate

Thread ID:

Created:

Updated:

Platform:

Replies:

104086 Jun 20,2012 11:35 AM UTC Oct 15,2014 04:59 PM UTC WPF 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 20, 2012 11:35 AM UTC

Hi,

It is possible to override GridDataStackedHeaderColumn.CellItemTemplate?

For example if I want GridDataStackedHeaderColumns-cell to contain button.

Thanks.

Regards,
Juraj

Sivakumar R [Syncfusion]
Replied On June 21, 2012 05:40 PM UTC

Hi Juraj,

 

You can achieve your requirement by handling QueryCellInfo event.

 

Code snippet:

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

{

    var style = e.Style as GridDataStyleInfo;

    if (style.CellIdentity.TableCellType == GridDataTableCellType.StackedColumnHeaderCell)

    {

        e.Style.CellType = "DataBoundTemplate";

        //e.Style.CellItemTemplate = Application.Current.Resources["CellItemTemplate"] as DataTemplate;

        e.Style.CellItemTemplateKey = "CellItemTemplate";

    }

}

 

 

Please find the sample from the below location

http://www.syncfusion.com/downloads/Support/DirectTrac/95789/StackedHeadersDemo1686720586.zip

 

Screen shot:

 

Thanks,

Sivakumar

 


Sivakumar R [Syncfusion]
Replied On June 21, 2012 05:43 PM UTC

Please find the screen shot below,

Thanks,

Sivakumar


Branden Boucher
Replied On October 15, 2014 04:59 PM UTC

Is there a way to pass along an object to the template instead of just the HeaderText so that some binding is possible within the template?

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

;