Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
felino Absent Member.
Absent Member.

[UFT] [WPF] DataGrid: get items of ControlTemplate

i'm testing a WPF application.

I have the source code:

			<Style TargetType="{x:Type GroupItem}">
				<Setter Property="Margin" Value="0,0,0,5"/>
				<Setter Property="Template">
						<ControlTemplate TargetType="{x:Type GroupItem}">

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

										<TextBlock Grid.Column="1" FontWeight="Bold" Margin="10,0,0,0" Width="Auto" VerticalAlignment="Center" Foreground="White">
													<MultiBinding Converter="{StaticResource TypeLot}" Mode="OneWay">
														<Binding Path="Name" />
														<Binding Path="DataContext" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}"/>
									<ItemsPresenter Visibility="{Binding ElementName=GroupLot, Path=IsExpanded, Converter={StaticResource BoolToVis}}" />

I worte this code for get ControlTemplate:


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


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.