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. Image for the cookie policy date
close icon

Header Template

Hi,
I have a GridGrouping Control that has headers composed of Buttons using the HeaderTemplate:

TemplateButtonItem tbi = new TemplateButtonItem();

Then I fill in the button info (ie, Text, onClick event, etc) and assign that to the GridGrouping Control:

GridGroupingControl1.TableDescriptor.Columns[ColID].HeaderTemplate = tbi;

This works fine but I need to update the Headers based upon new user information after the Grid is bound to the datasource. How can I get a reference to the TemplateButtonItem and then update the Text property off the button object?

I know it's simple, i just can't get the stuff to work.

Thanks.

David.

1 Reply

RS Rajarajeswari S Syncfusion Team October 18, 2007 03:06 PM UTC


Hi David,

Thanks for using Syncfusion products.

The text property of the button object can be updated by accessing the object which we assigned to the HeaderTemplate and TypeCast it to the appropriate class type.

Please refer the below code snippet to access the Template object.

TemplateButtonItem mytemp = ((TemplateButtonItem)this.GridGroupingControl1.TableDescriptor.Columns[3].HeaderTemplate);

then you can use the mytemp object to set the text property of the button


Please let me know if this helps you.

Regards,
S.Rajarajeswari

Loader.
Live Chat Icon For mobile
Up arrow icon