Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[UFT] [WPF] DataGrid: get items of ControlTemplate
#1
Not Solved
Hi,
i'm testing a WPF application.

I have the source code:
Code:
<DataGrid.GroupStyle>
    <GroupStyle>
        <GroupStyle.Panel>
            <ItemsPanelTemplate>
                <DataGridRowsPresenter/>
            </ItemsPanelTemplate>
        </GroupStyle.Panel>
        <GroupStyle.ContainerStyle>
            <Style TargetType="{x:Type GroupItem}">
                <Setter Property="Margin" Value="0,0,0,5"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GroupItem}">

                            <Expander Name="GroupLot" Loaded="GroupLot_Loaded" Expanded="GroupLot_Expanded" Collapsed="GroupLot_Collapsed" BorderThickness="1,1,1,5">
                                <Expander.Header>
                                    <Grid HorizontalAlignment="Stretch">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>

                                        [...]
                                        
                                        <TextBlock Grid.Column="1" FontWeight="Bold" Margin="10,0,0,0" Width="Auto" VerticalAlignment="Center" Foreground="White">
                                            <Run>Description:</Run>
                                            <Run>
                                                <Run.Text>
                                                    <MultiBinding Converter="{StaticResource TypeLot}" Mode="OneWay">
                                                        <Binding Path="Name" />
                                                        <Binding Path="DataContext" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}"/>
                                                    </MultiBinding>
                                                </Run.Text>
                                            </Run>
                                        </TextBlock>
                                        
                                    </Grid>
                                </Expander.Header>
                                <Expander.Content>
                                    <ItemsPresenter Visibility="{Binding ElementName=GroupLot, Path=IsExpanded, Converter={StaticResource BoolToVis}}" />
                                </Expander.Content>
                            </Expander>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </GroupStyle.ContainerStyle>
    </GroupStyle>
</DataGrid.GroupStyle>

I worte this code for get ControlTemplate:
Code:
WpfWindow("myApp").WpfTable("gridLots").Object.GroupStyle.Item(0).ContainerStyle.Setters.Item(1).Value

but, how can I get the expander and the TextBlock into it?

Thanks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no action on click for particular wpf button jlavrecka 1 1,409 05-21-2020, 11:33 PM
Last Post: jlavrecka
  Issue in QTP WPF vimal_selvam 5 14,247 06-26-2018, 05:40 PM
Last Post: rateebhatt
  UFT 14.01 - identifying wpf objects. but not performing action. chinmoyee 1 2,485 11-15-2017, 03:42 PM
Last Post: Ankur
  [UFT] [WPF] Verify if the cell contains an image robertosalemi 0 1,892 10-25-2016, 06:57 PM
Last Post: robertosalemi
  [UFT] [WPF] DataGrid: check if vertical and horizontal scrollbars are visible robertosalemi 0 2,407 07-13-2016, 06:33 PM
Last Post: robertosalemi

Forum Jump:


Users browsing this thread: 1 Guest(s)