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. Image for the cookie policy date

Text color in header column

Hi,

I'm using Essential Studio 6.3.0.30 with VS2008.

I'd like to use the GridGroupingControl, but I've got a problem with the look. I'd like to have my column header with white text, but whatever I do, it's still black.

I've tried to method :

CSS file :
In my css file :

.GgcCadre
{
color: white;
font-size: 15pt;
font-weight:bold;
background-color: #3596C3;
}

In my aspx file :

DataSourceCachingMode="ViewState" CellPadding="3" ShowGroupDropArea="false" Width="97%" CssClass="Ggc">












I've to say that the backcolor works great. But I've the same problem with the border (I can't apply style to it).

The second method I tried is :
In my vb file :

Protected Sub GGC_Design_QueryCellStyleInfo(ByVal sender As Object, ByVal e As GridTableCellStyleInfoEventArgs) Handles GGC_Design.QueryCellStyleInfo
If e.TableCellIdentity.TableCellType = GridTableCellType.ColumnHeaderCell Then
e.Style.TextColor = Color.White
End If
End Sub

It doesn't work either.

Have you got any idea for me please ?

Thanks a lot for your help.

LyLy




5 Replies

RS Rajarajeswari S Syncfusion Team December 2, 2008 02:08 PM UTC

Hi LyLy,

Thanks for using Syncfusion products.


Please refer the below code snippet for applying TextColor for the Column headers:

.GridBlueColumnHeaders
{
border-style: none;
background-color: #5898c5;
font: 700 11px Tahoma;


padding-left: 5px;
color: White;
cursor:default;
}
.GridBlueColumnHeadersText
{
font: 700 11px Tahoma;
color: White;
}


ASPX Code:



Please refer the sample from the below link, which illustartes this:

http://www.syncfusion.com/support/user/uploads/Sample_a0dc4af2.zip

Please let me know if you have any other concerns.

Regards,
Raji




LH Lucie Houel December 3, 2008 10:03 AM UTC

Hi Raji,

Thanks a lot for your help. It works great for the white text in the headers.

Unfortunately, I can't apply style to borders. The css properties for the borders only work for : GridBlueGrid and GridBlueColumnHeadersText. So I can't apply style to my header cells and my row cells border.

Thanks again.

LyLy



RS Rajarajeswari S Syncfusion Team December 8, 2008 09:39 AM UTC


Hi LyLy,

Thanks for using Syncfusion products.

Borders can be applied to GridGroupingControl through QueryCellStyleInfo event like below:

void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
{
e.Style.Borders.All = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.DashDot, Color.Red);
e.Handled = true;
}
}


Please try like this and let me know if this helps you out.

Regards,
Raji



LH Lucie Houel December 9, 2008 01:18 PM UTC

Hi Raji,

No it doesn't work for me, but I don't know the vb equivalent of :

e.Handled = true;

So I remove this line, does it possibly come from it ?

Thanks for your help.

LyLy



RS Rajarajeswari S Syncfusion Team December 11, 2008 11:15 AM UTC

Hi LyLy,

Thanks for using Syncfusion products.

Could you please DownLoad our latest version and check this. It is working fine with our latest version. Please refer the sample from the below link, which illustrates this:


http://websamples.syncfusion.com/samples/Grid.Web/6.4.0.15/GGC_Web_Border/main.htm


"Handled" is a propert included recently to apply the formattings set through the QueryCellStyleInfo event.


Please refer the below link, to download our latest version, which has lots of features implemented and also has many fixes:


http://www.syncfusion.com/downloads/default.aspx


Please try this and let me know if this helps you out.


Note:

Could you please create an DirectTrac Incident using your DirectTrac account for future support?

Regards,
Raji



Loader.
Live Chat Icon For mobile
Up arrow icon