Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

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

0
Sanmarie
Asked:
Sanmarie
  • 2
  • 2
2 Solutions
 
Bob LearnedCommented:
What are you trying to accomplish by writing the column headers in the first row of the DataGrid?

Bob
0
 
SanmarieAuthor Commented:

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
0
 
Melih SARICAIT ManagerCommented:
Use DatabindingComplete event to hadle data binding.
then change caption of the columns with the first row values
and then
delete row 1 from grid.

0
 
Bob LearnedCommented:
Here is a custom DataGrid class that allows multi-line headers:

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21809839.html

Bob
0
 
SanmarieAuthor Commented:
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
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now