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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I specify an image for a grid column header?

 

You can specify an image for a column header of a particular column via the Properties settings. Choose the Column via the TableDescriptor's Columns collection and set the ImageUrl property of the ColumnHeaderCell in the Appearance settings.

C#

this.GridGroupingControl1.TableDescriptor.Columns[0].Appearance.ColumnHeaderCell.ImageUrl = @"Images\Image1.PNG";

VB

Me.GridGroupingControl1.TableDescriptor.Columns(0).Appearance.ColumnHeaderCell.ImageUrl = "Images\Image1.PNG"

Additionally, if you also want to hide the text that will be displayed in the column header, take a look at the following code snippet. Note that you cannot set an empty text to the corresponding GridColumnDescriptor’s HeaderText property because the framework does not allow specifying empty text for column headers.

C#

private void GridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Web.UI.WebControls.Grid.Grouping.GridTableCellStyleInfoEventArgs e)

{

if(e.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell)

{

if(e.Style.Text == "ColName")

e.Style.Text = String.Empty;

}

}

VB

Private Sub GridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.Web.UI.WebControls.Grid.Grouping.GridTableCellStyleInfoEventArgs)

If e.TableCellIdentity.TableCellType = GridTableCellType.ColumnHeaderCell Then

If e.Style.Text = "ColName" Then

e.Style.Text = String.Empty

End If

End If

End Sub

Sample:

http://websamples.syncfusion.com/samples/KB/Grid.Web/6.1.0.34/GGCColumnHeader/main.htm

Article ID: Published Date: Last Revised Date: Platform: Control:
587 04/30/2011 07/10/2014 ASP.NET Web Forms (Classic) GridGroupingControl
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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