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

GGC Image in another column Header

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 ...

http://www.syncfusion.com/support/forums/grid-windows/43676.aspx

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.

Thanks
Ian S.



1 Reply

SR Sri Rajan Syncfusion Team 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
Else
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.
http://websamples.syncfusion.com/samples/grid.windows/F74709/main.htm

Please let me know if this helps.

Best Regards,
Srirajan


Loader.
Live Chat Icon For mobile
Up arrow icon