AD
Administrator
Syncfusion Team
October 8, 2003 05:48 PM UTC
Brian,
Thank you for evaluating our controls.
Regarding your second question. Did you try it as follows:
With Me.gridDataBoundGrid1.BaseStylesMap("Column Header").StyleInfo
.Trimming = StringTrimming.EllipsisCharacter
.WrapText = False
End With
That should normally work. If not I'll check again with the 1.6.1.0 codebase (which the eval is based on). Maybe we fixed it in a later patch.
To give UI feedback when mouse is pressed on a header you could override or add event handlers for the following events:
Dim mouseDownColIndex = -1
Protected Overrides Sub OnCellMouseUp(ByVal e As Syncfusion.Windows.Forms.Grid.GridCellMouseEventArgs)
mouseDownColIndex = -1
MyBase.OnCellMouseUp(e)
End Sub
Protected Overrides Sub OnCellMouseDown(ByVal e As Syncfusion.Windows.Forms.Grid.GridCellMouseEventArgs)
If (e.RowIndex = 0) Then
mouseDownColIndex = e.ColIndex
RefreshRange(GridRangeInfo.Cell(e.RowIndex, e.ColIndex))
End If
MyBase.OnCellMouseDown(e)
End Sub
Protected Overrides Sub OnPrepareViewStyleInfo(ByVal e As Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs)
If e.RowIndex = 0 Then
If e.ColIndex = Me.mouseDownColIndex Then
e.Style.BackColor = SystemColors.Highlight
' or
'e.Style.CellAppearance = GridCellAppearance.Sunken
Else
'e.Style.CellAppearance = GridCellAppearance.Raised
End If
End If
MyBase.OnPrepareViewStyleInfo(e)
End Sub
Protected Overrides Sub OnCellHitTest(ByVal e As Syncfusion.Windows.Forms.Grid.GridCellHitTestEventArgs)
If (e.RowIndex = 0) Then
e.Result = 1
e.Cancel = True
End If
MyBase.OnCellHitTest(e)
End Sub
I have to look into how to make SingleSelect and Selecting cells work at the same time. It's original intention for SingleSelect sorting was that at the same time the selection of columns should be disabled.
But let me also point you to
the Grid\Samples\Grouping demo. There you can drag column headers, give visual feedback while dragging with a bitmap
of the header and also handle single-click sorting. This is implemented by a special mouse controller that handles
both dragging the column header and single-click sorting.
Such a mouse controller could be ported to the databound grid to give it the same behavior.
Stefan
BB
Brian Bacon
October 9, 2003 11:19 AM UTC
Stephan,
This all sounds too good to be true and that grouping demo is exactly what I want. Now my only problem seems to be waiting for my supervisor to come back from vacation so I can show him all this wonderful stuff.