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.
Unfortunately, activation email could not send to your email. Please try again.

Is it possible to remove row/column headers

Thread ID:

Created:

Updated:

Platform:

Replies:

3189 Mar 7,2003 07:04 AM Mar 7,2003 11:24 AM Windows Forms 7
loading
Tags: GridControl
Maxim Software Systems
Asked On March 7, 2003 07:04 AM

Is it possible to remove (not just hide) row/column headers or change them so that they are like regular cells? If so, how is this done?

Administrator [Syncfusion]
Replied On March 7, 2003 07:34 AM

The recommended way to do this is to hide them. Why does this not work for you? That said, with a GridControl, you can try code such as:
this.gridControl1.Cols.HeaderCount = -1;
this.gridControl1.Cols.FrozenCount = -1;
this.gridControl1.Rows.HeaderCount = -1;
this.gridControl1.Rows.FrozenCount = -1;
which seems to work, but may have other problems depending upon exactly what you are doing. For a GridDataBoundGrid, it is a little more problematic in that the minus 1 seems to make the columns off by one. In this case, I think hiding the row headers is the way to go.

Maxim Software Systems
Replied On March 7, 2003 07:51 AM

> The recommended way to do this is to hide them. Why does this not work for you? If I just hide the headers, then I have invisible headers and can't work with the 0th row and column of the grid. This saves me a lot of headache. Why is it so odd to want a grid with no headers? This is what the original FlexGrid for VB6 did easily. > That said, with a GridControl, you can try code such as: >
> this.gridControl1.Cols.HeaderCount = -1;
> this.gridControl1.Cols.FrozenCount = -1;
> this.gridControl1.Rows.HeaderCount = -1;
> this.gridControl1.Rows.FrozenCount = -1;
> 
> which seems to work, but may have other problems depending upon exactly what you are doing. This works great, but I'm worried about these "other problems" that you are hinting at...

Maxim Software Systems
Replied On March 7, 2003 08:43 AM

> The recommended way to do this is to hide them. Why does this not work for you? > > That said, with a GridControl, you can try code such as: >
> this.gridControl1.Cols.HeaderCount = -1;
> this.gridControl1.Cols.FrozenCount = -1;
> this.gridControl1.Rows.HeaderCount = -1;
> this.gridControl1.Rows.FrozenCount = -1;
> 
> which seems to work, but may have other problems depending upon exactly what you are doing. I thought this would work, but it still hides the 0th row and column. :(

Administrator [Syncfusion]
Replied On March 7, 2003 08:50 AM

Why do you care whether the header is hidden or not?

Maxim Software Systems
Replied On March 7, 2003 09:08 AM

> Why do you care whether the header is hidden or not? It doesn't matter why I care, I just want to know if it can be done and, if so, how to do it. It was a valid request.

Administrator [Syncfusion]
Replied On March 7, 2003 10:29 AM

Sorry to be inquisitive. :) The reason I asked was if you had a particular problem you were encoutering or some behavior you wanted that you could not get, then maybe there is another way to resolve it.

Maxim Software Systems
Replied On March 7, 2003 11:24 AM

> Sorry to be inquisitive. :) That's okay. I've just seen too many responses on messageboards like: "Why would you do that?" "That's stupid, do this instead." etc. to valid questions...and I guess I'm a bit sensitive about it. :-P Sorry if I seemed a bit snooty. > The reason I asked was if you had a particular problem you were encoutering or some behavior you wanted that you could not get, then maybe there is another way to resolve it. I just would like to be able to reference columns and rows from a zero base so I don't have to add 1 to the indices whenever I'm filling it with data from other objects that I'm using. The only other possible solution to the problem of always having to add one to the indices is to change the base index of the objects I'm using from 0 to 1 to get data to fill the grid with, and that's not gonna happen. I can totally do the work with column and rows that start at 1, it would just make nicer code (and reduce the possibility of certain bugs) if it started at 0.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;