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

Grid Control

For a Grid, how do I programmatically control the Column headers (replace the A-Zs)?

4 Replies

CB Clay Burch Syncfusion Team June 26, 2002 06:12 AM

> For a Grid, how do I programmatically control the > Column headers (replace the A-Zs)? > > In Essential Grid, you can view the column headers as row zero. So, if you want col header 1 to have the header "Price", you can set the Text property for the style of cell 0,1 to "Price". gridControl1[0,1].Text = "price"; or in VB, gridControl(0,1).Text = "price"


SH Sam Horton June 26, 2002 07:55 AM

Thanks - Great tip! I also have a GridDataBoundGrid, but the object is quite different. For that type of control, how does one programmatically: (a) Set column text (b) Make the grid read-only (c) Freeze a column or row (d) Apply styles to cells, columns and rows If these are operations only possible in the Grid let me know and I'll use it instead.


CB Clay Burch Syncfusion Team June 26, 2002 01:11 PM

The GridDataBoundGrid is more of a column oriented grid. To set column properties, you can use the designer and work with the GridBoundColumns property. Using the editor, add a GridBoundColumn for each of your columns. Make sure you set the MappingName for each column so the column can be matched to the datasource. You can also set style properties for each column here as well. So, GridDataBoundGrid is basically a column centric grid, but you can do special things with events to catch specific cell appearance if needed.


SH Sam Horton June 26, 2002 08:34 PM

Thank you, Clay!

Loader.
Live Chat Icon For mobile
Up arrow icon