change column header separators
I am working with a GridGroupingControl of the current version. The enclosed images show what I try to achieve and what I currently have.
How can I change the column header separators to have a neat 3D design and have a little bit lesser height than the header cells itself, as shown in the attached image?
Thanks for your help.
How can I change the column header separators to have a neat 3D design and have a little bit lesser height than the header cells itself, as shown in the attached image?
Thanks for your help.
Images14.zip
SIGN IN To post a reply.
3 Replies
AD
Administrator
Syncfusion Team
August 4, 2006 01:22 PM UTC
Hi Mario,
Try setting the ColumnHeaderRowHeight property of the gridGroupingControl to change the height for column header row. The code snippet is,
this.grid.TableOptions.ColumnHeaderRowHeight = 13;
Thanks,
Haneef
Try setting the ColumnHeaderRowHeight property of the gridGroupingControl to change the height for column header row. The code snippet is,
this.grid.TableOptions.ColumnHeaderRowHeight = 13;
Thanks,
Haneef
MA
Mario
August 4, 2006 01:41 PM UTC
Hi Haneef,
I don''t want to change the height of the column header. Just the height of the separator line between two columns in the header should be changed. And the separator should have a sunken 3D look as in the images that I have attached to my first message of this thread. Please have a look at the images to understand what I try to achieve.
Regards, Mario
>Hi Mario,
Try setting the ColumnHeaderRowHeight property of the gridGroupingControl to change the height for column header row. The code snippet is,
this.grid.TableOptions.ColumnHeaderRowHeight = 13;
Thanks,
Haneef
I don''t want to change the height of the column header. Just the height of the separator line between two columns in the header should be changed. And the separator should have a sunken 3D look as in the images that I have attached to my first message of this thread. Please have a look at the images to understand what I try to achieve.
Regards, Mario
>Hi Mario,
Try setting the ColumnHeaderRowHeight property of the gridGroupingControl to change the height for column header row. The code snippet is,
this.grid.TableOptions.ColumnHeaderRowHeight = 13;
Thanks,
Haneef
AD
Administrator
Syncfusion Team
August 8, 2006 08:58 AM UTC
Hi Mario,
To avoid the space between the cells, you need to use the TableControlDrawCell event to draw the cell with required size. Please find the code snippet below.
GridTableCellStyleInfo info = e.Inner.Style as GridTableCellStyleInfo;
if( info.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Caption)
{
Rectangle rect = new Rectangle(new Point( e.Inner.Bounds.Location.X ,e.Inner.Bounds.Location.Y ) ,new Size(e.Inner.Bounds.Size.Width,e.Inner.Bounds.Height +2));
e.Inner.Renderer.Draw(e.Inner.Graphics,rect,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style);
e.Inner.Cancel = true;
}
if( info.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.ColumnHeader )
{
Rectangle rect = new Rectangle(new Point( e.Inner.Bounds.Location.X,e.Inner.Bounds.Location.Y - 2) ,new Size(e.Inner.Bounds.Size.Width ,e.Inner.Bounds.Height + 3));
e.Inner.Renderer.Draw(e.Inner.Graphics,rect,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style);
e.Inner.Cancel = true;
}
If you want to cancel the button3D look , you can set the Button3D property to false.
this.grid.TableModel.Properties.Buttons3D = false;
Thanks,
Haneef
To avoid the space between the cells, you need to use the TableControlDrawCell event to draw the cell with required size. Please find the code snippet below.
GridTableCellStyleInfo info = e.Inner.Style as GridTableCellStyleInfo;
if( info.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Caption)
{
Rectangle rect = new Rectangle(new Point( e.Inner.Bounds.Location.X ,e.Inner.Bounds.Location.Y ) ,new Size(e.Inner.Bounds.Size.Width,e.Inner.Bounds.Height +2));
e.Inner.Renderer.Draw(e.Inner.Graphics,rect,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style);
e.Inner.Cancel = true;
}
if( info.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.ColumnHeader )
{
Rectangle rect = new Rectangle(new Point( e.Inner.Bounds.Location.X,e.Inner.Bounds.Location.Y - 2) ,new Size(e.Inner.Bounds.Size.Width ,e.Inner.Bounds.Height + 3));
e.Inner.Renderer.Draw(e.Inner.Graphics,rect,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style);
e.Inner.Cancel = true;
}
If you want to cancel the button3D look , you can set the Button3D property to false.
this.grid.TableModel.Properties.Buttons3D = false;
Thanks,
Haneef
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
MA Mario
- Aug 4, 2006 08:15 AM UTC
- Aug 8, 2006 08:58 AM UTC