Returns or sets a value indicating what type of group icons SharpGrid will display in outline mode.
| Design time | Read / Write |
|---|---|
| Run time | Read / Write |
object.OutlineIcons As sgOutlineIcons
The object placeholder represents an object expression that evaluates to the SGGrid object.
The OutlineIcons settings are:
| Name | Value | Description |
|---|---|---|
| sgNoOutlineIcons | 0 | Do not display any group expand or collapse icons. |
| sgDefaultOutlineIcons | 1 | Displays the group expand icon as a "+" symbol and the group collapse icon as a "-" symbol. |
| sgCustomOutlineIcons | 2 | Displays user-defined group expand and collapse icons. |
Note: If the sgCustomOutlineIcons value is specified but not defined, SharpGrid will display any groups with the default Outline Icons (+/-).
This property takes effect only if the grid is grouped.
The following example adds football teams to a grid, groups them by conference, and uses the sgCustomOutlineIcons value to display group expand and collapse icons from SharpGrid's built-in image list. To try the example, place SharpGrid on a form. Paste the code into the Declarations section and press F5.
Private Sub SGGrid1_OnInit()
Dim i As Integer
Dim sData As String
Dim arRecords() As StringSGGrid1.Columns.RemoveAll
SGGrid1.FitLastColumn = True
SGGrid1.GroupIndentation = 0
'Remove all rows
SGGrid1.DataRowCount = 0
'Set some styles
With SGGrid1
.Styles("Heading").BackColor = RGB(165, 142, 107)
.Styles("GroupHeader").BackColor = RGB(231, 203, 123)
.BackColor = RGB(214, 207, 189)
End With
Const BIGTEN = _
"Penn State;Ohio State;Wisconsin;Northwestern;Michigan;Iowa;Minnesota;Purdue;Michigan State;Indiana;Illinois"
'Add columns
With SGGrid1.Columns.Add("Team")
.Caption = "Team"
.Style.TextAlignment = sgAlignLeftCenter
.Style.Format = "Standard"
End With
With SGGrid1.Columns.Add("Conference")
.Caption = "Conference"
.Style.TextAlignment = sgAlignLeftCenter
.Style.Format = "Standard".Hidden = True
End With
'Add team names to array
arRecords = Split(BIGTEN, ";")
For i = 0 To 10
'create a delimited string
sData = arRecords(i) & ";" & "Big Ten"'add row to the grid
SGGrid1.Rows.Add sgFormatCharSeparatedValue, sData, ";"
Next
Const IND = "Notre Dame;Navy;Army;Temple"
'Add team names to array
arRecords = Split(IND, ";")
For i = 0 To 3
'create a delimited string
sData = arRecords(i) & ";" & "Independent"'add row to the grid
SGGrid1.Rows.Add sgFormatCharSeparatedValue, sData, ";"
Next
'Group the teams by conference
SGGrid1.Groups.Add("Conference")
'Set the OutlineIcons property to custom icons
SGGrid1.OutlineIcons = sgCustomOutlineIcons
'Add custom icons using SharpGrid's image list
SGGrid1.GroupCollapseIcon = sgbipFirst + 2
SGGrid1.GroupExpandIcon = sgbipFirst + 3
SGGrid1.OutlineLines = sgGroupLines
End Sub
| See Also |
GroupExpandIcon Property | GroupCollapseIcon Property | SGGroups Object