We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

column header in syncfusion grouping control

Thread ID:

Created:

Updated:

Platform:

Replies:

47716 Aug 10,2006 03:40 PM UTC Aug 20,2006 03:42 PM UTC WinForms 8
loading
Tags: Grouping
Prem
Asked On August 10, 2006 03:40 PM UTC

How do I get rid of the white line in the column
header cell which ends up truncating the
column header text in the syncfusion grouping control.
I am using version 4.1.0.50

thanks,
prem

Administrator [Syncfusion]
Replied On August 11, 2006 09:50 AM UTC

Hi Prem,

Please try the code below in the TableControlDrawCell event of the gridgroupingcontrol, to resolve this. In this event handler, draw a line on top of the column header cell.

private void gridGroupingControl1_TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo info = e.Inner.Style as GridTableCellStyleInfo;
if( info.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell )
{
e.Inner.Renderer.Draw(e.Inner.Graphics, e.Inner.Bounds, e.Inner.RowIndex, e.Inner.ColIndex, e.Inner.Style);
e.Inner.Cancel = true;

Pen yPen = new Pen(SystemColors.Control);
yPen.Width = 1.5f;
e.Inner.Graphics.DrawLine(yPen,e.Inner.Bounds.Location, new Point(e.Inner.Bounds.X + e.Inner.Bounds.Width, e.Inner.Bounds.Y));
}
}

Let me know if this helps.
Thanks,
Rajagopal

Prem
Replied On August 11, 2006 03:17 PM UTC

Hi Rajagopal,
This did not work - I still see the white line which truncates the column header text when it wraps around. Also, the code you sent seems to draw a system color line - I guess I want to get rid of the existing white line.

Thanks,

>Hi Prem,

Please try the code below in the TableControlDrawCell event of the gridgroupingcontrol, to resolve this. In this event handler, draw a line on top of the column header cell.

private void gridGroupingControl1_TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo info = e.Inner.Style as GridTableCellStyleInfo;
if( info.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell )
{
e.Inner.Renderer.Draw(e.Inner.Graphics, e.Inner.Bounds, e.Inner.RowIndex, e.Inner.ColIndex, e.Inner.Style);
e.Inner.Cancel = true;

Pen yPen = new Pen(SystemColors.Control);
yPen.Width = 1.5f;
e.Inner.Graphics.DrawLine(yPen,e.Inner.Bounds.Location, new Point(e.Inner.Bounds.X + e.Inner.Bounds.Width, e.Inner.Bounds.Y));
}
}

Let me know if this helps.
Thanks,
Rajagopal

Administrator [Syncfusion]
Replied On August 14, 2006 06:15 AM UTC

Hi Prem,

Please try setting the Buttons3D property to false.

this.grid.TableModel.Properties.Buttons3D = false;

Let me know if this helps.
Best Regards,
Haneef

Prem
Replied On August 15, 2006 03:28 PM UTC

Hi Haneef,
That did not work - the text still gets truncated. Just curious if this is a known bug.

thanks,
Prem

>Hi Prem,

Please try setting the Buttons3D property to false.

this.grid.TableModel.Properties.Buttons3D = false;

Let me know if this helps.
Best Regards,
Haneef

Administrator [Syncfusion]
Replied On August 16, 2006 12:29 PM UTC

Hi Prem,

Sorry for the inconvenience caused.

We tried to reproduce this in 4.2, but could not get this issue. Maybe I am not following the steps that you are doing. Attached sample working fine here. Can you post a sample showing this problem or tell us how to see it in the Browser sample/attached sample?

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/HeaderText_3d1d23d1.zip

Thanks for your patience.
Regards,
Haneef

Prem
Replied On August 16, 2006 05:43 PM UTC

Hi Haneef,
First of all, I am using version 4.1.0.50.
In the sample you provided - after you run the application - reduce the width of the "ParentName" column - the column header text wraps around as expected but the top few pixels
of the letter "P" in the word "Parent" gets truncated.

Thanks,
Prem

>Hi Prem,

Sorry for the inconvenience caused.

We tried to reproduce this in 4.2, but could not get this issue. Maybe I am not following the steps that you are doing. Attached sample working fine here. Can you post a sample showing this problem or tell us how to see it in the Browser sample/attached sample?

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/HeaderText_3d1d23d1.zip

Thanks for your patience.
Regards,
Haneef

Administrator [Syncfusion]
Replied On August 17, 2006 07:41 AM UTC

Hi Prem,

Please try the code below in the TableControlDrawCell event of the gridgroupingcontrol, to resolve this. In this event handler, draw the text in the column header cell.

private void gridGroupingControl1_TableControlDrawCell(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDrawCellEventArgs e)
{
if( e.Inner.Style.CellType == "ColumnHeaderCell")
{
//Handle the DrawCell event.
e.Inner.Cancel = true;

GridStyleInfo style = e.Inner.Style;
string Text = e.Inner.Style.Text;
style.Text = string.Empty;

//Draw the ColumnHeader Without Text
e.Inner.Renderer.Draw(e.Inner.Graphics,e.Inner.Bounds,e.Inner.RowIndex,e.Inner.ColIndex,style);

//for Formatting the Text in columnHeader
StringFormat format = new StringFormat();
format.Alignment = StringAlignment.Center;
format.FormatFlags = StringFormatFlags.MeasureTrailingSpaces;
format.HotkeyPrefix = e.Inner.Style.HotkeyPrefix;
format.Trimming = e.Inner.Style.Trimming;

//for SortTriangle
Rectangle rect = e.Inner.Bounds;
rect.Width -= 10;

//Draw the Text in a ColumnHeader cell.
e.Inner.Graphics.DrawString(Text,e.Inner.Style.Font.GdipFont,new SolidBrush(e.Inner.Style.TextColor),rect,format);
}
}

Let me know if this helps.
Thanks,
Haneef

Prem
Replied On August 20, 2006 03:42 PM UTC

Hi Haneef,
This seems to be working.
Thanks for all your help.

Prem

>Hi Prem,

Please try the code below in the TableControlDrawCell event of the gridgroupingcontrol, to resolve this. In this event handler, draw the text in the column header cell.

private void gridGroupingControl1_TableControlDrawCell(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDrawCellEventArgs e)
{
if( e.Inner.Style.CellType == "ColumnHeaderCell")
{
//Handle the DrawCell event.
e.Inner.Cancel = true;

GridStyleInfo style = e.Inner.Style;
string Text = e.Inner.Style.Text;
style.Text = string.Empty;

//Draw the ColumnHeader Without Text
e.Inner.Renderer.Draw(e.Inner.Graphics,e.Inner.Bounds,e.Inner.RowIndex,e.Inner.ColIndex,style);

//for Formatting the Text in columnHeader
StringFormat format = new StringFormat();
format.Alignment = StringAlignment.Center;
format.FormatFlags = StringFormatFlags.MeasureTrailingSpaces;
format.HotkeyPrefix = e.Inner.Style.HotkeyPrefix;
format.Trimming = e.Inner.Style.Trimming;

//for SortTriangle
Rectangle rect = e.Inner.Bounds;
rect.Width -= 10;

//Draw the Text in a ColumnHeader cell.
e.Inner.Graphics.DrawString(Text,e.Inner.Style.Font.GdipFont,new SolidBrush(e.Inner.Style.TextColor),rect,format);
}
}

Let me know if this helps.
Thanks,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;