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.

GridDataStackedHeaderColumn CellItemTemplate

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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 01:40 PM

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 01:43 PM

Please find the screen shot below,

Thanks,

Sivakumar


Branden Boucher
Replied On October 15, 2014 12:59 PM

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.

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.

;