Hi,
I've tried the following to answer you question:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
Public Sub Form_Load()
Dim row As Integer
Dim col As Integer
Dim rowIndex As Integer = 2
Dim columnIndex As Integer = 3
JBGrid1.Cols = 4
JBGrid1.Rows = 6
JBGrid1.SelectionMode = flexSelectionFree
JBGrid1.Editable= jbEditOnClick
For row = 0 To JBGrid1.Rows - 1
For col = 0 To JBGrid1.Cols - 1
JBGrid1.DataMatrix(row, col) = row & ";" & col
JBGrid1.DataMatrix(row, col).CanGetFocus = True
JBGrid1.DataMatrix(row, col).Editable= True
JBGrid1.DataMatrix(row, col).Enabled= True
JBGrid1.DataMatrix(row, col).TextAlign= fmTextAlignCenter
Next col
Next row
JBGrid1.Refresh
JBGrid1.Parent.clearSelection()
JBGrid1.Parent.changeSelection(rowIndex, columnIndex, False, False)
JBGrid1.DataMatrix(rowIndex, columnIndex).Parent.requestFocus
JBGrid1.DataMatrix(rowIndex, columnIndex).SetFocus
Me.Refresh
End Sub
|
It might inspire you for own experiments, but the code does not work.
To focus on a button, you simply write "Command1.Parent.requestFocus()", but I could not make that work for the JBGrid as a whole nor for a single DataMatrix element. Might be a misunderstanding on my side or a deficiency in the Jabaco framework.
Greetings!
A1880