将一行网格移动到上面的行

时间:2013-10-14 20:07:56

标签: c# wpf xaml grid stackpanel

在下文中,如何将名为Duration的字段移动到上面的行,将其移动到行尾。

<dxe:DateEdit Name="edtEndDate"
              MinWidth="80"
              Grid.Row="0"
              Grid.Column="0"
              EditValue="{Binding Controller.DisplayEndDate}"
              Validate="OnEdtEndDateValidate"
              IsEnabled="{Binding ReadOnly, Converter={dxschd:InvertedBoolConverter}}"
              Margin="0,0,0,3"
              DisplayFormatString="MM-dd-yy" />

<dxe:ButtonEdit Grid.Row="0"
                Grid.Column="1"
                Name="edtEndTime"
                MinWidth="90"
                MaskType="DateTime"
                DisplayFormatString="hh:mm tt"
                Mask="{Binding TimeEditMask}"
                EditValue="{Binding Controller.DisplayEndTime, Converter={StaticResource timeSpanToDateTimeConverter}}"
                AllowDefaultButton="False"
                IsEnabled="{Binding ElementName=chkAllDay, Path=IsChecked, Converter={StaticResource invertedBoolConverter}}"
                Validate="OnEdtEndTimeValidate"
                IsReadOnly="{Binding ReadOnly}"
                Margin="0,0,0,3"
                EditValueChanged="edtEndTime_EditValueChanged">
  <dxe:SpinButtonInfo SpinUpCommand="{Binding SpinUpCommand, ElementName=edtEndTime}"
                      SpinDownCommand="{Binding SpinDownCommand, ElementName=edtEndTime}"></dxe:SpinButtonInfo>
</dxe:ButtonEdit>
<TextBlock Grid.Row="0"
           Grid.Column="2"
           Text="Duration:"
           Margin="5,0,0,0" />
<TextBox Grid.Row="0"
         Grid.Column="3"
         x:Name="txtDuration"
         HorizontalAlignment="Left"
         Margin="5,0,0,0"
         TextWrapping="Wrap"
         VerticalAlignment="Top"
         Width="50"
         IsEnabled="False"
         FontWeight="Bold" />

<Label Grid.Row="0"
       Grid.Column="4"
       Content="Restrictions:"
       HorizontalAlignment="Right"
       Margin="30,0,0,0"></Label>
<dxe:ComboBoxEdit Grid.Row="0"
                  Grid.Column="5"
                  IsEnabled="{Binding CanSetSchedule}"
                  SelectedIndex="{Binding Controller.ScheduleType}"
                  IsTextEditable="False"
                  Width="90"
                  HorizontalAlignment="Right">
  <dxe:ComboBoxEdit.Items>
    <dxe:ComboBoxEditItem>None</dxe:ComboBoxEditItem>
    <dxe:ComboBoxEditItem>Allow</dxe:ComboBoxEditItem>
    <dxe:ComboBoxEditItem>Restrict</dxe:ComboBoxEditItem>
  </dxe:ComboBoxEdit.Items>
</dxe:ComboBoxEdit>

1 个答案:

答案 0 :(得分:0)

您可以使用堆叠面板......

<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1">

    <dxe:ButtonEdit.../>
    <TextBlock .../>

</StackPanel

&GT;