0

您好,提前感谢您的帮助。我有两个面板,一个带有一系列按钮,一个 Telerik RadTreeView 被边框包围,右侧另一个边框包含网格和其他一些控件。当我调整页面大小等时,所有内容的大小都正确,但是由于某种原因,大约有 10 个像素被截断,无法想到原因。如果是页面容器问题,它将影响页面右侧的边框。所以我认为它一定与我正在使用的 RadTreeView 或 WrapPanel 有关。(归结代码就在下图之后)

左侧黑色边框显示被截断的 10 个像素,而右侧黑色边框显示延伸到整个页面长度的网格边框。

<!-- Code -->
<controls:ViewBase xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                             xmlns:WindowControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
                             xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
                             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

  <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>
  </Grid.RowDefinitions>

  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
  </Grid.ColumnDefinitions>

  <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" x:Name="titleTxt" Text="My Title" Style="{StaticResource textBlockHeaderStyle}"/>

  <toolkit:WrapPanel Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Stretch" MaxWidth="400" Margin="2,2,2,10">   

        <!-- Some Buttons Here.... -->

            <telerik:RadTreeView HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SelectionMode="Single" IsLineEnabled="True"
                               ItemsOptionListType="None" IsOptionElementsEnabled="True" IsDragDropEnabled="False"
                               IsRootLinesEnabled="True" Margin="0,5,0,0" IsTriStateMode="True" FontSize="11" BorderThickness="1" BorderBrush="Black"/>

  </toolkit:WrapPanel>

  <sdk:GridSplitter Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Style="{StaticResource gridSplitterStyle}"/>

  <Border Grid.Row="1" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                Background="Transparent" BorderThickness="1" BorderBrush="Black">
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

      <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>

      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>

      <Grid Grid.Row="0" Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">

        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid Grid.Row="0" Grid.Column="0">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
          </Grid.ColumnDefinitions>

            <!-- Some Buttons Here.... -->

        </Grid>

        <telerik:RadGridView  Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>

      </Grid>

    </Grid>
  </Border>

</Grid>

4

1 回答 1

0

没有时间也没有兴趣研究 RadTreeView 或 WrapPanel 的基础模板/样式。我可以通过简单地将 RadTreeView 放在它自己的行中并将按钮和其他控件留在包装面板中来解决问题并维护布局。无论如何,假设它更简单。

肯定是这两个控件的错误或兼容性问题可能无法解决。

于 2014-11-17T20:57:55.887 回答