Question

In the following, how do I move the field called Duration, to the row above it move it to the end of the line.

<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>
Was it helpful?

Solution

You can use a Stack Panel...

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

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

</StackPanel

>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top