The idea was to implenete a search in a Grid on a Diaalog.
I beleave it can be done loading data in an Array and then try to locate a certain data position
like this:
’ iLine= LocateBinSearch(Array(Idx); stxtPesquisa ): Integer; ’ a iLine
’ Args(3).Value = iLine then goto iLine
oGrid = oDlg.getControl(“tab_g1”).model.GridDataModel ???
oDispatch.executeDispatch(oDocFrm.oGrid ???, “.uno:GotoLine”, “”, 0, args)
The question marks are my great doubts
I found no examples about Grids inside a Dialog box
The mean idea is to performe a uno:gotoline after locate a certain key in an Array(idx) where Idx will be the line to go to.
the nain idea is to get the very same efect as in this example for calc:
Sub GotoRow
dim oDoc as object
dim oController as object
dim oSheet as object
dim oFrame as object
dim oSelection as object
dim oRange as object
dim oCell as object
dim oDispatcher as object
dim lRowNr as long
dim lColNr as long
dim lToRow as long
dim sCellName as string
dim sToRow as string
dim args1(0) as new com.sun.star.beans.PropertyValue
oDoc = Thiscomponent
oController = oDoc.getCurrentController
oFrame = oController.Frame
oSheet = oController.ActiveSheet
oRange = oDoc.getCurrentSelection()
lRowNr = oRange.getRangeAddress.StartRow
lColNr = oRange.getRangeAddress.StartColumn
sToRow = InputBox("Please enter a row number:", "Dear User")
lToRow = val(sToRow)
if lToRow <= 0 then lToRow = 1
oCell = oSheet.GetCellByPosition(lColNr,lToRow-1) 'zero based
sCellName = oCell.absolutename
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
args1(0).Name = "ToPoint"
args1(0).Value = sCellname
oDispatcher.executeDispatch(oFrame, ".uno:GoToCell", "", 0, args1())
End Sub
Can you help? Best Regards