Link to home
Start Free TrialLog in
Avatar of Sanmarie
Sanmarie

asked on

How get column Headers to automatically move down as user scrolls down datagrid

Using Windows Forms, .NET 1.1, VS 2003

I have a custom datagrid control inherited from a datagrid. I am using a dataTable to populate the datagrid. I have used the first row of my dataTable for the column headers and made the columnheaders of the datagrid invisible by setting:
grid.ColumnHeadersVisible = False

But, as the user scrolls down they won't see the headers. How can I write code to make the headers move down as the user scrolls down?

Thanks

San

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

What are you trying to accomplish by writing the column headers in the first row of the DataGrid?

Bob
Avatar of Sanmarie
Sanmarie

ASKER


I couldn't get the text to wrap by using the datagrid's column headers so I just decided to put them in the first row. what I have is a cross-tab with the first row being the column headers, the first column being the row headers and the data in the middle being the intersecting row-column values. when the user clicks on a value, it gives the corresponding row value in column 0 and the corresponding column value in row 0.

Sanna
ASKER CERTIFIED SOLUTION
Avatar of Melih SARICA
Melih SARICA
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry for taking long to respond.

Bob, I had found your link some time ago but it didn't work for me. I was getting an error. I think one other person on the code project was getting a similar error. It was taking too long to figure out so I decided to scrap it. So far my grid is working perfectly.

Would I need the column headers in order to get them to move down as the user scrolls down? Or, could it still work with the headers in the first row of the dataTable?

Non_Zero, could you elaborate a little bit more. I'm not clear on your suggestion.

Thank you both.

Sanna