Is it possible to center DataGrid.CaptionText?

I would like to make the CaptionText of a DataGrid (not the columns) centered, but there does not appear to be any sort of access to Alignment.

Am I missing something? I know that I could just put a label control over that part of the grid, but i was wondering if there is another property I can use

Thanks,

[312 byte] By [RickHodder] at [2007-12-16]
# 1
My guess is probably not, but I'm not a Visual Studio expert.

You could try a quick fix:
Create a new DataGrid derived from the standard DataGrid control and override the onPaint (or onPaintBackground) method (not sure which one is used for the CaptionText). In that control, after all the base painting occurs, paint over the Caption Text (using FIllRectangle), and then Redraw the Caption Text in the appropriate "centered" position.

nathankoterba at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
thanks for the idea, nathan
RickHodder at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...