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

column header

This is my problem, I change the default text of the Header of the columns, but if I click on the caption of the header and the whole column is selected, on caption appear the default name of the column (A,B,C etc.) How can I solve this problem? Which is the event that select the column? Thanks Nicola

4 Replies

AD Administrator Syncfusion Team April 20, 2005 04:40 AM

In a GridControl, to set column header text, you should set the style.Text of the cell in row 0. grid[0, 3].Text = "MyHeaderForCol3"; To turn off column selections when you click a header, in the grid.AllowSelecions property, remove the Columns flag.


AD Administrator Syncfusion Team April 20, 2005 04:44 AM

In a GridDataBoundGrid, you set teh HeaderText using the property in the GridBoundColumn for that column. ''if you have not added GridBoundColumns Me.GridDataBoundGrid1.Binder.InternalColumns("Col1").HeaderText = "header for Col1" ''if you have added GridBoundColumns Me.GridDataBoundGrid1.GridBoundColumns("Col1").HeaderText = "header for Col1"


NI nicola April 20, 2005 05:14 AM

I use this code for set the column header text: If e.ColIndex = 1 AndAlso e.RowIndex = 0 Then e.Style.Text = "Data Creazione" End If Even if I remove the flag in the grid.AllowSelecions property if I click on the top of the column, the caption change showing the default value. >In a GridControl, to set column header text, you should set the style.Text of the cell in row 0. > >grid[0, 3].Text = "MyHeaderForCol3"; > >To turn off column selections when you click a header, in the grid.AllowSelecions property, remove the Columns flag.


AD Administrator Syncfusion Team April 20, 2005 05:45 AM

Where are you using this code? In PrepareViewStyleInfo or in QueryCellinfo? Try using it in QueryCellInfo if you are using PrepareViewStyleInfo.

Loader.
Live Chat Icon For mobile
Up arrow icon