Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Make a simple grid with cell-button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Make a simple grid with cell-button

 Post Reply Post Reply
Author
Message
francamato View Drop Down
Newbie
Newbie
Avatar

Joined: 25 July 2013
Location: Italy
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote francamato Quote  Post ReplyReply Direct Link To This Post Topic: Make a simple grid with cell-button
    Posted: 01 August 2013 at 12:08pm
Good morning, 

anyone has an example with sources to implement a very simple grid, like the one in the attached image.


Is a few weeks I use this Suite Pro 2013, and this component is really powerful and complete, but I can not find the way to make one or more columns fixed (button with icon) before the 0th column of datagrid...

I have made this code, but the result is very disappointing

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



I hope it is possible to do this very simple thing Cry ,  thank you in advance

A.Francesco
Product: Xtreme SuitePro (ActiveX) 16.2.0
Platform: XP / Windows 7
Language: Visual Basic 6.0 SP6
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.