Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - RC as a Grid
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

RC as a Grid

 Post Reply Post Reply
Author
Message
Albert1 View Drop Down
Groupie
Groupie
Avatar

Joined: 01 February 2007
Location: Italy
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote Albert1 Quote  Post ReplyReply Direct Link To This Post Topic: RC as a Grid
    Posted: 13 August 2010 at 6:21pm
Hello,
I am using CJ controls since about 3 years and now I'm trying to use RC a as a grid for data entry (to finally substitute vs**ex and tdb**id). The approach row/item seems good however I encountered some problems (testing RC):
 
  1. To have a good interface (i.e.: Access 2007+) I think user should have immediatelly the position of the active cell. MS Access uses an orange border around the active cell. Can we simulate in ReportControl (not simply changing the BG/FG color)?
  2. If the active cell contains a ComboBox and I select something (a costraint value) then the backspace doesnt nothing. The only way to change the value (without selecting other value by opening combo) is to use left arrow+delete key.
  3. In real forms (at least on mines) we could have more than only a single ReportControl. If I use the keyboard I notice that when I reach the last item in the last row the Tab key has no effect. I cannot ask to my customers to use the mouse to navigate to the next control in the form...
 
Some hints?
TY
Alberto
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)

Back to Top
Albert1 View Drop Down
Groupie
Groupie
Avatar

Joined: 01 February 2007
Location: Italy
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote Albert1 Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2010 at 4:58am
Originally posted by Albert1 Albert1 wrote:

If I use the keyboard I notice that when I reach the last item in the last row the Tab key has no effect.
 
I get this why I set:
.FocusSubItems = True
 
No one has similar problems? I guess all people are using RC only to show records with no editing. O am I fully wrong?
 
 
From the reference of a famous grid (not updated anymore in the ActiveX version):
 
Quote

TabAction Property

This property defines the behavior of the tab key.

Syntax

wndReportControl.TabAction = value

Values

Design Time

Run Time

0 - Control Navigation (default)

dbgControlNavigation

1 - Column Navigation

dbgColumnNavigation

2 - Grid Navigation

dbgGridNavigation

3 - Grid Column Navigation

dbgGridColumnNavigation

Remarks

Read/Write at run time and design time.

If set to 0 - Control Navigation (the default), the Tab key moves to the next or previous control on the form.

If set to 1 - Column Navigation, the Tab key moves the current cell to the next or previous column. However, if this action would cause the current row to change, then the next or previous control on the form receives focus.

If set to 2 - Grid Navigation, the Tab key moves the current cell to the next or previous column. The behavior of the tab key at row boundaries is determined by the WrapCellPointer property. When this setting is used, the tab key never results in movement to another control.

If set to 3 - Grid Column Navigation, the focus goes to the next control in the tab order when the Tab key is entered on the last column of the last row.

 
I am talking about a grid created about 15 years ago ...
 
I am trying to reach the [3] behaviour by using in RC:
.TrapTabKey = True
however the result is so combersome.
 
Is there a better solution?
 
TY
 
 
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)

Back to Top
Albert1 View Drop Down
Groupie
Groupie
Avatar

Joined: 01 February 2007
Location: Italy
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote Albert1 Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2010 at 10:59am
Working on the Tab behaviour for my forms I discovered the PreviewKeyDown event. I have to admit it: in about 15 years of VB programming no one gave us such a powerful event. This increases the fire power to the infinite
 
So I drop down some lines of code I wish to share.
 
In a new form insert (in the order): a textbox, a reportcontrol, a button (reportcontrol is in the middle) and add this code:
 

Option Explicit
Private Sub Form_Load()
Dim i As Integer
Dim Record As ReportRecord
Dim Item As ReportRecordItem
   
    With Me.ReportControl1
       
        For i = 0 To 2
            With .Columns.Add(i, "Column" & i, 100, False)
                .Editable = True
            End With
        Next
        For i = 1 To 5
            Set Record = .Records.Add
                Set Item = Record.AddItem("")
                    Item.CreateEditOptions
                    Item.EditOptions.AddComboButton True
                    Item.EditOptions.MaxLength = 10
                Record.AddItem ""
                Record.AddItem ""
        Next i
   
        .Populate
        .AllowEdit = True
        .FocusSubItems = True
        .SelectionEnable = True
        .EditOnClick = True
    End With
End Sub
Private Sub ReportControl1_GotFocus()
    ReportControl1.FocusSubItems = True
End Sub
Private Sub ReportControl1_PreviewKeyDown(KeyCode As Integer, ByVal Shift As Integer, Cancel As Boolean)
Dim intfc As Integer, intfr As Integer  ' focused col / row
Dim rpt As ReportControl
   
    If KeyCode = Asc(vbTab) Then
        Set rpt = ReportControl1
        intfc = -1: intfr = -1
        '
        On Error Resume Next
        intfc = rpt.FocusedColumn.Index
        intfr = rpt.FocusedRow.Index
        On Error GoTo 0
        '
        If intfc > -1 Or intfr > -1 Then
            If Shift > 0 Then
                If intfc <= 0 Then
                    If intfr = 0 Then
                        rpt.FocusSubItems = False
                    End If
                End If
            Else
                If intfc = rpt.Columns.Count - 1 Then
                    If intfr = rpt.Rows.Count - 1 Then
                        rpt.FocusSubItems = False
                    End If
                End If
            End If
        End If
    End If
End Sub
 
There are still two questions to resolve:
1) When Shift+Tab from button to ReportControl, the last Row is selected but to edit some row's cell I need to Tab and start from the first column instead of the last (maybe I have to save the RC activecell and restore when enter).
2) When Shift+Tab from RC to textbox and I am in row 0, col 0 the inplacebutton remains visible.
 
However its enough for start working with a real project .
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

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.137 seconds.