Highlighted
Absent Member.. Absent Member..
Absent Member..
735 views

wpfGrid Identified as WpfObject, cant to get Values from SelectedItems

Hello to All

I have some WpfDialogs in our App, but i cant to get data from WpfGrid that identified as WpfObject

to Get number of rows i success

Here is the code but to get values from row i cant, anybody know something?

 

Set oObject = WpfWindow("regexpwndtitle:=Control Points""devname:=Control  Points").WpfObject("devname:=_gridControlPoints")
    Set oItemsObject = oObject.Object
    tmpCPBefore = oItemsObject.ItemsSource.Count 'Count the rows

 

I can also select rows using SelectedIndex Param

oObject.Object.SelectedIndex = 1 'Select Row

 

Thanks

0 Likes
5 Replies
Highlighted
New Member.

Re: wpfGrid Identified as WpfObject, cant to get Values from SelectedItems

Give a try like below:

 

msgbox oObject.Object.SelectedRow.ToString()

or

msgbox oObject.Object.SelectedRow.SelectedCell.ToString()

or

msgbox oObject.Object.Rows(1).Cells(1).ToString()

msgbox oObject.Object.Rows(1).Cells(1).Text

msgbox oObject.Object.Rows(1).Cells(1).Value

Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
Test Automation Ecstasy
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: wpfGrid Identified as WpfObject, cant to get Values from SelectedItems

oObject.Object.SelectedRow.ToString()

return : <Object doesn't support this property or method: 'oObject.Object.SelectedRow'>

 

oObject.Object.SelectedRow.ToString() and oObject.Object.SelectedRow.SelectedCell.ToString()

return:  <Object doesn't support this property or method: 'oObject.Object.SelectedRow'>

 

oObject.Object.Rows(1).Cells(1).ToString()

oObject.Object.Rows(1).Cells(1).Text

oObject.Object.Rows(1).Cells(1).Value

return: <Object required: 'oObject.Object.Rows(...)'>

 

But oObject.Object.Rows(1)

return "{null}"

 

something strange!!!

 

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: wpfGrid Identified as WpfObject, cant to get Values from SelectedItems

And one more thing

oObject.Object.SelectedItems.ToString()

return:

"C1.WPF.FlexGrid.SelectedItemList" as "String Type"

 

But i cant to get Something from there (

 

 

0 Likes
Highlighted
New Member.

Re: wpfGrid Identified as WpfObject, cant to get Values from SelectedItems

One more to try.

 

oItemsObject.ItemsSource.Rows  'See whether it returns some collection

 

Also try with AutomationElement (I didn't used this, not sure how to use). But give a try by analyzing this, seems it will help a bit.

Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
Test Automation Ecstasy
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: wpfGrid Identified as WpfObject, cant to get Values from SelectedItems


@maxims wrote:

And one more thing

oObject.Object.SelectedItems.ToString()

return:

"C1.WPF.FlexGrid.SelectedItemList" as "String Type"

 

But i cant to get Something from there (

 

 


You have to find the name of the Grid, so you can refer the Object's documentation, in order to access it's internal methods/properties.

 

You can do it by spying the object (.NET) or by talking to a developer.  In this case you are dealing with a C1 Flex Grid and here's the document for the grid.

 

http://www.componentone.com/newimages/Products/Doc​umentation/WPF.FlexGrid.pdf

 

Here's also a snippet you can try.

 

Msgbox oObject.Object.Rows.Count

 

Msgbox oObject.Object.Rows.Item(1).GetDataFormatted(1)

 

If this doesn't work, you can refer the documentation & fix it.

_____________________
Rajkumar Rajangam
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.