Forum Discussion
- irina_lukinaSuper Contributor
Hi Vikas,
Have you tried using the following code?
WPFObject("grid").Items.CountAlso, there are some helpful links below that will help you get started:
1. Working With Grids
This topic describes how to work with grid controls (including WPF grids) in TestComplete.
2. How to retrieve data from WPF datagrid through TestComplete
This forum thread contains a similar question, and you can use it to find out some additional information.I hope, this information helps :)
- vjjohnson04Occasional Contributor
hi,
thanks for the help. I got the count using the below code.
Can u enlighten me on using the WPFObect("Grid").items.count as i get an type mismatch error.
Code:
sub get_row_count
i=Aliases.EFLT_EO_UI.HwndSource_MainView.MainView.Grid.mainTabControl.FeatureView.LayoutRoot.ResidenceSearchView.Grid.advanceResultRadGridView.items.count
end sub - irina_lukinaSuper Contributor
Hi Vikas,
Sorry for confusing you. The WPFObject method is applied to the window that holds your control (data grid). That is, you should use the following code:
Obj = Aliases.EFLT_EO_UI.HwndSource_MainView.MainView.Grid.mainTabControl.FeatureView.LayoutRoot.ResidenceSearchView
Count = Obj.WPFObject("Grid").Items.CountFor more information on using the WPFObject method, see its description in the TestComplete online help.