Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to fetch the data from a data grid
#1
Hi gintaras,

how can i read/write to a data grid.....

scenario: i have a data grid having 4 columns and 20 rows.....
first i want to get the number of used rows.... then read/ write on a particular cell in the grid

eg: i want to read a cell of row 2 column 3


thanks,
Nithin
#2
What data grid?
#3
.Net data grid
#4
I don't know a way other than using keyboard.
#5
refer to the attachment

I have a data grid from Dot Net as shown in the attachment

When I try to capture the accessible objects I am able to see the columns and row numbers as shown below

Using this information is it possible to read/ write values to the data grid cells..?


Attached Files Image(s)
   
#6
Try accessible object actions "get name", "get value", "get description", "set value", "select". Most object don't allow to set value. Then you can select and set value using keyboard.
#7
Member function Acc.GetNetDataGridCell
Code:
Copy      Help
function# nColumns [row] [col] [Acc&ac]

;Retrieves accessible object for specified cell in NET data grid.
;This object must be data grid. You can call this function multiple times with it.
;Returns the number of used rows.
;nColumns is the number of columns in the grid.
;row and col are 1-based row and column indexes.


;EXAMPLE
;Acc aGrid=acc("DataGrid" "TABLE" win("Customer Details" "WindowsForms10.Window.8.app4") "WindowsForms10.Window.8.app4" "" 0x1001)
;Acc aCell
;int i
;for i 0 aGrid.GetNetDataGridCell(11)

,;aGrid.GetNetDataGridCell(11 i+1 1 aCell)
,;out aCell.Value
,;;aCell.SetValue("new value")


int n=a.ChildCount-nColumns-2
if(&ac)
,if(row>n) end "row too big"
,str s.format("child%i child%i" row+nColumns+1 col)
,Navigate(s ac)
,
ret n
err+ end _error
#8
your function works fine..
thanks Gintaras...


Forum Jump:


Users browsing this thread: 1 Guest(s)