-
August 9th, 2004, 03:24 PM
#1
DataGrid Column header height
I just want to know if it's possible to change the height of the column header in a DataGrid. I have found options for bouth height and width og the row header, but only width option for the column header.
Is it changable, and in that case; how do I change it?
(I need to write two lines of text in the header, and if I can't change the header height, the bottom line will not be shown)
Thanks for all answers! I am really stuck here...
-
August 10th, 2004, 07:48 AM
#2
plz! I am really stuck here. If anyone have any idea, that might solve my problem, or you have seen this problem before, plz tell me!
-
January 7th, 2013, 01:31 PM
#3
Re: DataGrid Column header height
So I've been unable to find anything on this for two days now and finally decided just go ahead and manually come up with a solution. First I added a thumb to the bottom of the header then I added a couple of event handlers to give the expected functionality:
private void Thumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
{
double change = e.VerticalChange;
RulesGrid.ColumnHeaderHeight = Math.Max(20, RulesGrid.ColumnHeaderHeight + change);
}
private void Thumb_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
RulesGrid.ColumnHeaderHeight = double.NaN;
}
I hope that helps. I really can't understand why this has to be added in the first place...
-
January 7th, 2013, 01:51 PM
#4
Re: DataGrid Column header height
This is a more complete answer.
private void Thumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
{
double change = e.VerticalChange;
RulesGrid.ColumnHeaderHeight = double.IsNaN(RulesGrid.ColumnHeaderHeight) ? mousePosition.Y : // mouse position gotten from
Math.Max(20, RulesGrid.ColumnHeaderHeight + change);
}
private void Thumb_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
RulesGrid.ColumnHeaderHeight = double.NaN;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|