Print Page | Close Window

SOLVED: - Enable TAB Key navigation

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=16638
Printed Date: 15 November 2024 at 11:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: - Enable TAB Key navigation
Posted By: markmark
Subject: SOLVED: - Enable TAB Key navigation
Date Posted: 27 April 2010 at 5:02am

Hi

 

In the example code, I cannot get the tab key to move focus from one cell item to another.

Anyone know how to do this? (The arrow keys would do, just need keyboard navigation not just the mouse)

 

Thanks

 

Mark
 
Private Sub Form_Load()
Dim Column As ReportColumn
Dim RecordControl As ReportRecord
Dim rRecord As ReportRecord
Set Column = wndReportWaste.Columns.Add(0, "Group", 80, True)
Column.EditOptions.SelectTextOnEdit = False
Column.Visible = False
Set Column = wndReportWaste.Columns.Add(1, "Product", 80, True)
Column.EditOptions.SelectTextOnEdit = True
Set Column = wndReportWaste.Columns.Add(2, "SOT", 70, True)
Column.EditOptions.SelectTextOnEdit = True
Set Column = wndReportWaste.Columns.Add(3, "Inner", 110, True)
Column.EditOptions.SelectTextOnEdit = True
Set rRecord = wndReportWaste.Records.Add()
rRecord.AddItem "1": rRecord.AddItem "Paper": rRecord.AddItem "": rRecord.AddItem ""
Set rRecord = wndReportWaste.Records.Add()
rRecord.AddItem "1": rRecord.AddItem "Cardboard": rRecord.AddItem "": rRecord.AddItem ""
Set rRecord = wndReportWaste.Records.Add()
rRecord.AddItem "1": rRecord.AddItem "Plastics": rRecord.AddItem "": rRecord.AddItem ""
Set rRecord = wndReportWaste.Records.Add()
rRecord.AddItem "1": rRecord.AddItem "Glass": rRecord.AddItem "": rRecord.AddItem ""

wndReportWaste.AllowEdit = True
wndReportWaste.EditOnClick = True
wndReportWaste.Populate
End Sub


-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0



Replies:
Posted By: SuperMario
Date Posted: 27 April 2010 at 9:14am
Also set:

wndReportWaste.FocusSubItems = True




Posted By: markmark
Date Posted: 27 April 2010 at 11:00am
Hi
 
Thanks for your reply
 
I have added  wndReportWaste.FocusSubItems = True
which nearly gets me there,
Because I have
wndReportWaste.EditOnClick = True
 
Tabbing into a cell item doesn't select the contents
 
Any Ideas?
 
Mark


-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0


Posted By: SuperMario
Date Posted: 27 April 2010 at 4:20pm
there is ReportRecordItemEditOptions.SelectTextOnEdit


Posted By: markmark
Date Posted: 28 April 2010 at 2:40am
Hi
 
I added the code but still can't get it to work.
Could you please check my code below
 
Thanks very much
 
Mark
 
 
 
Private Sub Form_Load()
Dim Column As ReportColumn
Dim RecordControl As ReportRecord
Dim rRecord As ReportRecord
Dim Item As ReportRecordItem
Set Column = wndReportWaste.Columns.Add(0, "Group", 80, True)
Column.EditOptions.SelectTextOnEdit = False
Column.Visible = False
Set Column = wndReportWaste.Columns.Add(1, "Product", 80, True)
Column.EditOptions.SelectTextOnEdit = True
Set Column = wndReportWaste.Columns.Add(2, "SOT", 70, True)
Column.EditOptions.SelectTextOnEdit = True
Set Column = wndReportWaste.Columns.Add(3, "Inner", 110, True)
Column.EditOptions.SelectTextOnEdit = True
Set rRecord = wndReportWaste.Records.Add()
Set Item = rRecord.AddItem("1")
Item.CreateEditOptions
Item.EditOptions.SelectTextOnEdit = True
Set Item = rRecord.AddItem("Paper")
Item.CreateEditOptions
Item.EditOptions.SelectTextOnEdit = True
Set Item = rRecord.AddItem("")
Item.CreateEditOptions
Item.EditOptions.SelectTextOnEdit = True
Set Item = rRecord.AddItem("")
Item.CreateEditOptions
Item.EditOptions.SelectTextOnEdit = True
Set rRecord = wndReportWaste.Records.Add()
Set Item = rRecord.AddItem("1")
Item.CreateEditOptions
Item.EditOptions.SelectTextOnEdit = True
Set Item = rRecord.AddItem("Water")
Item.CreateEditOptions
Item.EditOptions.SelectTextOnEdit = True
Set Item = rRecord.AddItem("")
Item.CreateEditOptions
Item.EditOptions.SelectTextOnEdit = True
Set Item = rRecord.AddItem("")
Item.CreateEditOptions
Item.EditOptions.SelectTextOnEdit = True
wndReportWaste.FocusSubItems = True

wndReportWaste.AllowEdit = True
wndReportWaste.EditOnClick = True
wndReportWaste.Populate
End Sub


-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0


Posted By: SuperMario
Date Posted: 28 April 2010 at 8:22am
Your code works fine for me, but I have 13.3.1.

Note you don't need to set SelectTextOnEdit for both column and item, if you want the entire column like that then just set the column.  Only set individual items if you don't want all items in the column to have this behavior.


Posted By: markmark
Date Posted: 28 April 2010 at 9:56am
Ok, Well I can't just update every user with the new version yet.
We are on ver 13.0.0
do you know of any work about so I can Select Text On Edit  after Tabing to the item with the above code.
 
 
Thanks for helping me out with this
 
Mark
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0


Posted By: SuperMario
Date Posted: 28 April 2010 at 11:54am
Indeed, you are right, 13.0 does not behave as intended.  I went back through and 13.1 is the first version to work correctly.

Here is a workaround I found to work OK, you can make the condition more strict, but here is the basic idea.  You could just use selection changed if you always want it click\tab\whatever:

Dim bFocusChanged As Boolean

Private Sub wndReportControl_FocusChanging(ByVal NewRow As XtremeReportControl.IReportRow, ByVal NewColumn As XtremeReportControl.IReportColumn, ByVal NewItem As XtremeReportControl.IReportRecordItem, Cancel As Boolean)
    bFocusChanged = True
End Sub

Private Sub wndReportControl_SelectionChanged()
    On Error Resume Next
    If bFocusChanged Then
        wndReportControl.Navigator.BeginEdit
    End If
    bFocusChanged = False
End Sub


Posted By: markmark
Date Posted: 29 April 2010 at 3:46am
Thanks Very Very Very  Much  SuperMario
That did it
 
 
 
Cheers
 
Mark


-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net