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.
Unfortunately, activation email could not send to your email. Please try again.

GGC Image in another column Header

Thread ID:

Created:

Updated:

Platform:

Replies:

74709 Jun 25,2008 09:39 AM Jun 26,2008 06:23 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 25, 2008 09:39 AM

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.



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

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


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.

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.

;