我正在尝试对齐网格视图下方的文本块、文本框和按钮。现在它们的顺序是正确的,但它们被集中在左边。我希望它们从左到右均匀分布在网格视图下方,并延伸到整个窗口。这是xaml。
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel>
<telerik:RadGridView x:Name="radGridView"
GroupRenderMode="Flat"
ShowGroupPanel="True"
ColumnWidth="*"
IsReadOnly="True"
Grid.Row="0"
CanUserFreezeColumns="False"
RowIndicatorVisibility="Collapsed"
CanUserResizeColumns="True"
ShowGroupFooters="True"
ShowColumnFooters="True"
ItemsSource="{Binding Path=Tester}" />
<telerik:RadDataPager x:Name="radDataPager"
Grid.Row="1"
PageSize="10"
Source="{Binding Items, ElementName=radGridView}"
DisplayMode="All"
IsTotalItemCountFixed="True"/>
<StackPanel Orientation="Horizontal">
<TextBlock Grid.Row="2"
TextWrapping="Wrap"
HorizontalAlignment="Stretch"
Text="Search Testing"/>
<TextBox ToolTip="Enter Search into box"
x:Name="txtName"
Grid.Row="2"
FontFamily="Courier New"
HorizontalAlignment="Stretch"
TextWrapping="Wrap"
Text="{Binding SearchText}"/>
<telerik:RadButton ToolTip="Click To Search"
x:Name="btnSearch"
Content="Search"
Grid.Row="2"
HorizontalAlignment="Stretch"
Click="RadButton_Click_1"/>
</StackPanel>
</StackPanel>
</Grid>