Micro Focus QTP (UFT) Forums
[UFT] [WPF] DataGrid: check if vertical and horizontal scrollbars are visible - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: [UFT] [WPF] DataGrid: check if vertical and horizontal scrollbars are visible (/Thread-UFT-WPF-DataGrid-check-if-vertical-and-horizontal-scrollbars-are-visible)



[UFT] [WPF] DataGrid: check if vertical and horizontal scrollbars are visible - robertosalemi - 07-13-2016

Hi,
i have a DataGrid, this is the source code:
Code:
<DataGrid x:Name="commonStepGrid" AutoGenerateColumns="False" HeadersVisibility="Column"  
               Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="2"
               SelectionChanged="commonStepGrid_SelectionChanged"  CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True"
               SelectionUnit="FullRow" SelectionMode="Extended"                     
               ScrollViewer.CanContentScroll="True" IsReadOnly="True"
               HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
               AlternationCount="2" >

I have to check is vertical or horizontal scrollbars are visible.

I use this code fro get the properties of DataGrid, but it not works:
Code:
cc = WpfWindow("myApp").WpfTable("commonStepGrid").Object.HorizontalScrollBarVisibility
bb = WpfWindow("myApp").WpfTable("commonStepGrid").Object.VerticalScrollBarVisibility

Thanks for the support.