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 09:40 AM UTC

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 09:44 AM UTC

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 10:14 AM UTC

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 10:45 AM UTC

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

Loader.
Up arrow icon