GridDataStackedHeaderColumn CellItemTemplate

Hi,

It is possible to override GridDataStackedHeaderColumn.CellItemTemplate?

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

Thanks.

Regards,
Juraj

3 Replies

SR Sivakumar R Syncfusion Team 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

 



SR Sivakumar R Syncfusion Team June 21, 2012 05:43 PM UTC

Please find the screen shot below,

Thanks,

Sivakumar



BB Branden Boucher 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?

Loader.
Up arrow icon