2012-12-27 2 views
3

Xceed DataGrid의 Codeplex 버전을 사용하고 있습니다.
그러나 그리드를 형태로 표시하는 동안 'Powered by Xceed'텍스트가 DataGrid의 오른쪽 위에옵니다.
enter image description hereXceed DataGrid에서 기본 텍스트 제거

이것을 제거 할 수 있습니까? 방법?

+1

커뮤니티 버전을 사용하는 경우 라이센스 계약에 위배됩니다 (워터 마크 없음 = 플러스 에디션). – punker76

답변

7

나는 이것을 시도했다. 그것은 효과가 있었다.

<Style TargetType="{x:Type xcdg:HierarchicalGroupByControl}"> 
      <Setter Property="Visibility" Value="Collapsed"/> 
     </Style> 
2

나는이 짧은 글을 다른 날에 작성했습니다. 간단한 확장 메서드를 만들어서 adorner 레이어를 찾아 제거했습니다.

public static class XceedDataGridExtensions 
{ 
    public static void RemoveWaterMark(this DataGridControl grid) 
    { 
    object hgbc = XceedDataGridExtensions.FindChild<HierarchicalGroupByControl>(grid, null); 
    AdornerLayer al = AdornerLayer.GetAdornerLayer(hgbc as Control); 
    al.Visibility = System.Windows.Visibility.Collapsed; 
    } 

    static T FindChild<T>(DependencyObject parent, string childName) where T : DependencyObject 
    { 
    // Confirm parent and childName are valid. 
    if (parent == null) return null; 
     T foundChild = null; 
    int childrenCount = VisualTreeHelper.GetChildrenCount(parent); 
    for (int i = 0; i < childrenCount; i++) 
    { 
     var child = VisualTreeHelper.GetChild(parent, i); 
     // If the child is not of the request child type child 
     T childType = child as T; 
     if (childType == null) 
     { 
     // recursively drill down the tree 
     foundChild = FindChild<T>(child, childName); 
     // If the child is found, break so we do not overwrite the found child. 
     if (foundChild != null) break; 
     } 
     else if (!string.IsNullOrEmpty(childName)) 
     { 
     var frameworkElement = child as FrameworkElement; 
     // If the child's name is set for search 
     if (frameworkElement != null && frameworkElement.Name == childName) 
     { 
      // if the child's name is of the request name 
      foundChild = (T)child; 
      break; 
     } 
     } 
     else 
     { 
     // child element found. 
     foundChild = (T)child; 
     break; 
     } 
    } 

    return foundChild; 
    } 
} 

당신은 여기에 대한 자세한 내용을보실 수 있습니다 : http://blog.itsnotfound.com/2013/02/xceed-community-datagridcontrol-watermark-removal/ 또한, 내 의견과 같은 @의 punker76가 커뮤니티 사이트에서 토론 스레드에 명시되어

는, 워터 마크의 제거가 MSPL에 아닙니다 . 개발자들은 소스 코드 수정을 통해 워터 마크를 제거하는 방법을 인정했습니다. 심지어 수용 가능한 해결책을 찾고 있습니다. 여기에 설명을 참조하십시오 : 예처럼 "축소"로 재산 Visibility

<xcdg:DataGridControl Grid.ColumnSpan="3" 
          UpdateSourceTrigger="CellContentChanged" 
          Grid.Row="8" 
          AutoCreateColumns="False" 
          IsDeleteCommandEnabled="True" 
          SelectionMode="Single" 
          ItemsSource="{Binding Instructions,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"> 
     <xcdg:DataGridControl.View> 
      <xcdg:TableView ShowRowSelectorPane="False" 
          UseDefaultHeadersFooters="False" 
          ColumnStretchMode="All"> 
       <xcdg:TableView.FixedHeaders> 
        <DataTemplate> 
         <DockPanel> 
          <xcdg:ColumnManagerRow DockPanel.Dock="Right" 
                AllowColumnReorder="False" 
                AllowColumnResize="False" /> 
          <xcdg:GroupByControl x:Name="groupByControl" 
               Visibility="Collapsed" /> 
         </DockPanel> 
        </DataTemplate> 
       </xcdg:TableView.FixedHeaders> 
      </xcdg:TableView> 
     </xcdg:DataGridControl.View> 
     <xcdg:DataGridControl.Columns> 
      <xcdg:Column Title="Title" 
         FieldName="Title" /> 
      <xcdg:Column Title="Content" 
         FieldName="Content" /> 
      <xcdg:Column Title="Image Url" 
         FieldName="ImageUrl" /> 
     </xcdg:DataGridControl.Columns> 
    </xcdg:DataGridControl> 

그냥 설정 값 : http://wpftoolkit.codeplex.com/discussions/428413

1

내가 가장 단순한 방법은 제거 할 수 있다고 생각 GroupByControlFixedHeaders 속성을 수정하는 것입니다.