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
close icon

Is it possible to remove row/column headers

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?

7 Replies

AD Administrator Syncfusion Team March 7, 2003 12:34 PM UTC

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.


MS Maxim Software Systems March 7, 2003 12:51 PM UTC

> 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...


MS Maxim Software Systems March 7, 2003 01:43 PM UTC

> 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. :(


AD Administrator Syncfusion Team March 7, 2003 01:50 PM UTC

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


MS Maxim Software Systems March 7, 2003 02:08 PM UTC

> 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.


AD Administrator Syncfusion Team March 7, 2003 03:29 PM UTC

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.


MS Maxim Software Systems March 7, 2003 04:24 PM UTC

> 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.

Loader.
Live Chat Icon For mobile
Up arrow icon