A good question that indicates the docu should be improved a little bit. We'll add the answer below to it with the next update.
Every iGrid column is represented with an iGCol object you can retrieve using the indexed Cols collection property. The iGCol properties determine the general column look (width, text, sort index) and behavior (the ability to resize, move, sort, etc). If you need to change the text displayed in a column's header, you can do that using the iGCol.Text property. The following code sets a new column header text for the first column:
iGrid1.Cols[0].Text = "New column's text";
To access other properties which define look - color, font, etc - you need to use the collection of header cells. iGrid can have several rows in the header too, and you access the header cells using the two-dimensional iGrid.Header.Cells array. When you access a header cell, the first index is the row and the second index is the column. In most cases iGrid has one header row, so the row index equals zero.
Here is a code snippet to change the header text color and its text for the first column:
iGrid1.Header.Cells[0, 0].Value = "Another text";
iGrid1.Header.Cells[0, 0].ForeColor = Color.Red;
Note that some settings like background color may be unavailable if the header is drawn using the current OS visual style. To turn them off, set the iGrid.Header.UseXPStyles property to false.
As one more approach, you can change the style of all column headers within one column using the iGCol.ColHdrStyle property. For example, to set the font for the first column header to bold, use this code:
iGrid1.Cols[0].ColHdrStyle.Font = new Font(iGrid1.Font, FontStyle.Bold);
Edited by user
2012-12-07T13:57:43Z
|
Reason: Not specified