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

GGC Image in another column Header

Thread ID:





74709 Jun 25,2008 01:39 PM UTC Jun 26,2008 10:23 AM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On June 25, 2008 01:39 PM UTC

Hi there,

I'm trying to alter an image that has been drawn over another column heading.

The code to alter the image originally uses code found in this old article ...


But I need to be able to click on one column heading and then turn off the image on another column.

Any help would be gratefully appreciated.

Ian S.

Sri Rajan [Syncfusion]
Replied On June 26, 2008 10:23 AM UTC

Hi Ian,

Thank you for your interest in Syncfusion products.

You need to handle TableControlQueryAllowSortColumn event and a flag variable to turn on or off the image on one header when you click on the another header cell. Please refer the below code for more details.

Private Sub gridGroupingControl1_TableControlQueryAllowSortColumn(ByVal sender As Object, ByVal e As GridQueryAllowSortColumnEventArgs)
If e.Column.Name = "Col0" Then
If flag = 1 Then
flag = 0
flag = 1
End If
End If
End Sub

Private Sub gridGroupingControl1_TableControlCellDrawn(ByVal sender As Object, ByVal e As GridTableControlDrawCellEventArgs)
If flag = 1 Then
Dim style As GridTableCellStyleInfo = TryCast(e.Inner.Style, GridTableCellStyleInfo)
If style.TableCellIdentity.TableCellType = GridTableCellType.ColumnHeaderCell AndAlso style.TableCellIdentity.Column IsNot Nothing AndAlso style.TableCellIdentity.Column.Name = "Col1" Then
GridStaticCellRenderer.DrawImage(e.Inner.Graphics, Me.imageList1, 0, e.Inner.Bounds, False)
End If
End If
End Sub

Here is the minimal sample which implements this task.

Please let me know if this helps.

Best Regards,


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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