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

How to name (not bounded) gridControl''s column

Hi, everyone

I'd like to know how can I name gridControl's column.
It needs to be something simple like naming column of not bounded datagridview control in microsoft V.S (something like: myGrid.Columns(2).Name = "clmMyColumnName3").

Thanks in advance :)
Allon

P.S
My bet was grdMyGrid.ColStyles(3).Name = "clmMyColumnName3", but it hadn't worked.

5 Replies

JJ Jisha Joy Syncfusion Team September 16, 2009 06:22 AM UTC

Hi Allon,

Thank you for posting query to us.

In GridControl, you could access the columnHeader row by using the rowindex 0 and set the name using the Text property. See the code:

this.gridControl1[0, 3].Text = "Column3";

Please let me know if this does not serve your needs.

Regards,
Jisha



AL Allon September 16, 2009 06:58 AM UTC

Hi, Jisha

The line that you suggested me (this.gridControl1(0, 3).Text = "Column3") gives me information that only will be seen as an header of the column. What I really wanted to do, is naming the 3rd column, for referencing later. In V.S, when I want to reference particular column, first I name it (something like grdControl1.Columns(2).Name = "clmMy3rdColumn"), and during runtime, I reference it as grdControl1.Columns(2).Name .

Meanwhile, I've been using the Tag property, even though it's a little bit ridicules :)

Regards,
Allon


JJ Jisha Joy Syncfusion Team September 16, 2009 12:07 PM UTC

Hi Allon,

GridControl is a cell oriented grid. We cannot give column Names to the grid as it is not bounded to any datasource. It is not a bounded grid like DataGridView. But our other grid controls GridGroupingControl and GridDataBoundGrid is bounded grids.
Here is a short description of each of the grids that we ship.

GridControl - This is a cell oriented grid (meaning you can set properties cell by cell). It has excel like formula support. It supports a virtual mode and is the grid of choice for light-weight, high performance applications where the main goal is to to display rapidly changing information with minimal CPU load. It is also the grid of choice for Excel like applications needing formula support. This grid when not used in virtual mode stores the displayed data in its own data structures, allowing it to support nice features like nested undo/redo out of the box.

GridListControl - This is a Windows Forms ListControl derived class that wraps a GridControl with allows you to implement code to do things that are hard to do with the Windows Forms ListControl. It really is a potential replacement for a Windows Forms ListControl if there is something you need to do with your listcontrol that the Windows Forms ListControl cannot do.

GridDataBoundGrid - This was an early grid that was intended to provide an alternative to the 1.0 Windows Forms DataGrid. It is a bound grid, and does not hold any data. It gets its values to display from an external DataSource. Currently, it serves as a light-weight grid for simple bound applications that do not require nested table support, filtering, grouping, etc.

GridGroupingControl - This is a bound grid that supports nested tables, filtering, groupings, summaries, etc. It is our most complete featured bound grid. And as such, should be considered first for any application where you want a grid to display data in a external datasource.

Please let me know if you have any specific questions.

Regards,
Jisha


AL Allon September 17, 2009 07:59 AM UTC

Hi, Jisha

Thanks for the comprehensive explanation of all your grid controls. From now on, it will be simpler to choose the correct grid.

Thanks a lot :)
Allon


JJ Jisha Joy Syncfusion Team September 17, 2009 11:37 AM UTC

Hi Allon,

Thank you for your update.

Regards,
Jisha

Loader.
Live Chat Icon For mobile
Up arrow icon