tryandcatch.net

Blogs from tryandcatch.net
Welcome to tryandcatch.net Sign in | Join | Help
in Search

Juan Pablo Rizzo's Blog

Writing text in the row header column of a Winform DataGrid

Today I've been asked about how to write text on the row header column of a Winform DataGrid (The first column of the grid). I know that it can be hidden with the RowHeadersVisible property, but I didn't know how to write on it.

The WinForms DataGrid hasn't got any property for write text on the row headers. The only way to do this is write a handler for the DataGrid's Paint event and then calculate where the row headers are and write the text using the DrawString method of the Graphics class.

Here you can find a complete source code example of writting text in the DataGrid's row headers.

I hope it helps.

Published Wednesday, February 08, 2006 10:20 AM by jprizzo
Filed Under:
Anonymous comments are disabled

This Blog

Post Calendar

<February 2006>
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
2627281234
567891011

Syndication

Powered by Community Server, by Telligent Systems