Home Forums WinForms controls Xceed Grid for WinForms How to get cell value from selected row Reply To: How to get cell value from selected row

User (Old forums)
Member
Post count: 23064

Frederic, I am in similar situation where I have to get cell value from row, using QTP.

Thank you for you reply, but I am not  under “you need to cast the collection of  Xceed.Grid.Row selectedRows property output by a – most likeley – inherited class CellRow.”

 In my case what is “gridcontrol1”?

if I execute below code, I get number of rows
Set x = SwfWindow(“FormName”).SwfObject(“grid”).Object.DataRows
y = x.Count
MsgBox y

if I execute below code,
Set t = SwfWindow(“FormName”).SwfObject(“grid”).Object.DataRows(0).
no options are displayed by QTP.
When I type “.” QTP gives some options, example “SwfWindow(“FormName”).SwfObject(“grid”).Object.DataRows.” QTP displayes count etc options and I can select, but when I type
“Set t = SwfWindow(“FormName”).SwfObject(“grid”).Object.DataRows(0).” no options are displayed

Can you please help me?

Imported from legacy forums. Posted by steve (had 1250 views)