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

GridTreeControl - how to customize the header of one column?

I haven't been able to find any info on how to do this,

Basically, I want to have a hyperlink in one column header:

I also tried to put the new control on top of the gridtreecontrol, but then I did not manage to hide the previous HeaderText, if I specify an empty string or {x:Null} then the GridTreeControl 'helpfully' sets the Header equal to MappingName.

So, how to do it?

3 Replies

GA Gobinath A Syncfusion Team June 20, 2013 11:09 AM UTC

Hi Simon,

 

Sorry for the delay in getting back to you.

 

We have analyzed your query and you can achieve your requirement by using following code snippet.

 

Code snippet[C#]:

 

this.treeGrid.InternalGrid.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);

 

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

 {

    if (e.Style.ColumnIndex == 2 && e.Style.RowIndex==0)

      {

        e.Style.CellType = "Hyperlink";

 

       //you can customize the header text using e.Style.CellValue=””;

 

      }

  }

 

We have prepared the sample based on your requirement and please find the sample under the following location.

 

Sample: CellEditorsDemo_2010.zip

 

Please let us know if you have any queries.

 

Regards,

Gobinath A.

 

 



SD Simon Dahlbacka July 3, 2013 11:12 AM UTC

Ok, that seems to work

(If we ignore the fact that alignment and margins are totally off and the colors look horrible...)


GA Gobinath A Syncfusion Team July 25, 2013 08:38 AM UTC

Hi Simon,

 

Sorry for the delay in getting back to you.

 

We are unable to understand what you have mentioned in this line “If we ignore the fact that alignment and margins are totally off and the colors look horrible” so could you please more information regarding your update.

 

Regards,

Gobinath A.

 


Loader.
Live Chat Icon For mobile
Up arrow icon