Private Sub Form_Load()
Dim i As Integer
Dim j As Integer
With ReportControl
.Move 120, 120
.AutoColumnSizing = False
.AllowColumnRemove = False
.FocusSubItems = True
.ShowRowFocus = True
.AllowEdit = True
.BorderStyle = xtpBorderFlat
.EditOnClick = True
.PaintManager.FixedRowHeight = False
.PaintManager.ColumnStyle = xtpColumnFlat
.PaintManager.VerticalGridStyle = xtpGridSolid
.PaintManager.FreezeColsDividerStyle = xtpReportFixedRowsDividerBold
.PaintManager.FreezeColsDividerColor = RGB(90, 90, 90)
.PaintManager.GridLineColor = RGB(140, 140, 140)
.PaintManager.GrayIfDisable = False
.PaintManager.HighlightBackColor = RGB(120, 130, 100)
For i = 0 To 5
.Columns.Add i, "Col " & Chr$(65 + i), 150, False
If i = 0 Then
.Columns(i).Alignment = xtpAlignmentCenter
.Columns(i).Sortable = False
.Columns(i).AllowRemove = False
.Columns(i).AutoSize = False
.Columns(i).Editable = False
.Columns(i).Resizable = False
.Columns(i).Width = 100
.Columns(i).AllowDrag = False
Else
.Columns(i).Sortable = True
.Columns(i).Editable = True
.Columns(i).Resizable = True
End If
Next i
For i = 0 To 20
With .Records.Add
.AddItem Chr$(65) & i
.Item(0).BackColor = ReportControl.PaintManager.CaptionBackColor
Set Button = .Item(0).ItemControls.AddButton(-1)
Button.Enable = True
Button.Alignment = xtpReportItemControlUnknown
For j = 1 To 5
.AddItem Chr$(65 + j) & i
Next j
End With
Next i
.Populate
.FreezeColumnsCount = 3
.DisableReorderColumnsCount = 1
End With
End Sub
Private Sub ReportControl_ColumnOrderChangedEx(ByVal Column As XtremeReportControl.IReportColumn, ByVal Reason As XtremeReportControl.XTPReportColumnOrderChangedReason)
If Reason = xtpReportColumnOrderChanged Then
If Column.Index > ReportControl.FreezeColumnsCount Then
Column.Move (Column.ItemIndex)
ReportControl.Redraw
End If
End If
End Sub