当前位置: 首页>>代码示例>>C#>>正文


C# DataGridContext类代码示例

本文整理汇总了C#中DataGridContext的典型用法代码示例。如果您正苦于以下问题:C# DataGridContext类的具体用法?C# DataGridContext怎么用?C# DataGridContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DataGridContext类属于命名空间,在下文中一共展示了DataGridContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateGenerator

    internal static CustomItemContainerGenerator CreateGenerator( DataGridControl parentGridControl, CollectionView collectionView, DataGridContext dataGridContext )
    {
      CustomItemContainerGenerator newGenerator = new CustomItemContainerGenerator( collectionView, dataGridContext, parentGridControl );
      dataGridContext.SetGenerator( newGenerator );

      return newGenerator;
    }
开发者ID:wangws556,项目名称:duoduo-chat,代码行数:7,代码来源:CustomItemContainerGenerator.cs

示例2: GetNextVisibleFocusableColumnIndex

    internal static int GetNextVisibleFocusableColumnIndex( DataGridContext dataGridContext, Row targetRow, ColumnBase targetColumn )
    {
      if( ( dataGridContext == null ) || ( targetRow == null ) || ( targetColumn == null ) )
        return -1;

      var columns = dataGridContext.VisibleColumns;
      if( ( columns == null ) || ( columns.Count <= 0 ) )
        return -1;

      var columnIndex = columns.IndexOf( targetColumn );
      if( columnIndex < 0 )
        return -1;

      if( !dataGridContext.IsAFlattenDetail )
        return NavigationHelper.GetNextVisibleFocusableColumnIndex( dataGridContext, targetRow, columnIndex + 1 );

      var columnMap = dataGridContext.ItemPropertyMap;
      var masterColumnName = default( string );

      if( !columnMap.TryGetColumnFieldName( targetColumn, out masterColumnName ) )
        return -1;

      var masterDataGridContext = dataGridContext.RootDataGridContext;
      var masterColumn = masterDataGridContext.Columns[ masterColumnName ];

      if( masterColumn == null )
        return -1;

      var masterColumnIndex = masterDataGridContext.VisibleColumns.IndexOf( masterColumn );
      if( masterColumnIndex < 0 )
        return -1;

      return NavigationHelper.GetNextVisibleFocusableDetailColumnIndexFromMasterColumnIndex( dataGridContext, targetRow, masterColumnIndex + 1 );
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:34,代码来源:NavigationHelper.cs

示例3: ColumnStretchingManager

    public ColumnStretchingManager( DataGridContext dataGridContext )
    {
      if( dataGridContext == null )
        throw new ArgumentNullException( "dataGridContext" );

      m_dataGridContext = dataGridContext;
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:7,代码来源:ColumnStretchingManager.cs

示例4: HasGroup

    public static bool HasGroup( DataGridContext dataGridContext )
    {
      if( dataGridContext.GroupLevelDescriptions.Count > 0 )
        return true;

      return GroupingHelper.HasGroup( dataGridContext.DetailConfigurations );
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:7,代码来源:GroupingHelper.cs

示例5: DataGridContextAutomationPeer

    internal DataGridContextAutomationPeer(
      DataGridControl dataGridControl,
      DataGridContext parentDataGridContext,
      object parentItem,
      DetailConfiguration detailConfiguration )
    {
      if( dataGridControl == null )
        throw new ArgumentNullException( "dataGridControl" );

      if( parentDataGridContext == null )
      {
        m_dataGridContext = dataGridControl.DataGridContext;
      }
      else
      {
        m_dataGridContext = parentDataGridContext.GetChildContext( parentItem, detailConfiguration );
      }

      if( m_dataGridContext != null )
        m_dataGridContext.Peer = this;

      m_dataGridControl = dataGridControl;
      m_parentDataGridContext = parentDataGridContext;
      m_parentItem = parentItem;
      m_detailConfiguration = detailConfiguration;

      m_dataChildren = new Hashtable( 0 );
      m_headerFooterChildren = new Hashtable( 0 );
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:29,代码来源:DataGridContextAutomationPeer.cs

示例6: GetLastVisibleFocusableColumnIndex

    internal static int GetLastVisibleFocusableColumnIndex( DataGridContext dataGridContext )
    {
      if( dataGridContext == null )
        return -1;

      return NavigationHelper.GetLastVisibleFocusableColumnIndex( dataGridContext, dataGridContext.CurrentRow );
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:7,代码来源:NavigationHelper.cs

示例7: Group

    internal Group( GroupGeneratorNode node, CollectionViewGroup group, IList<GroupLevelDescription> groupLevelDescriptions, DataGridContext dataGridContext )
    {
      if( node == null )
        throw new ArgumentNullException( "node" );

      if( group == null )
        throw new ArgumentNullException( "group" );

      if( groupLevelDescriptions == null )
        throw new ArgumentNullException( "groupLevelDescriptions" );

      if( dataGridContext == null )
        throw new ArgumentNullException( "dataGridContext" );

      m_generatorNode = node;
      m_collectionViewGroup = group;
      m_groupDescriptionsCollection = groupLevelDescriptions;
      m_dataGridContext = dataGridContext;

      //In case no late bingding is to happen, and if we already have everything to get the groupLevelDescription immediately, let's do!
      int level = m_generatorNode.Level;
      if( m_groupDescriptionsCollection.Count > level )
      {
        m_groupLevelDescription = m_groupDescriptionsCollection[ level ];
      }
      m_lateGroupLevelDescriptionBindingPerformed = false;

      m_generatorNode.TotalLeafCountChanged += OnTotalItemCountChanged;
      m_generatorNode.IsExpandedChanged += OnIsExpandedChanged;
    }
开发者ID:Torion,项目名称:WpfExToolkit,代码行数:30,代码来源:Group.cs

示例8: Group

    internal Group(
      GroupGeneratorNode node,
      CollectionViewGroup group,
      LateGroupLevelDescription groupLevelDescription,
      DataGridContext dataGridContext )
    {
      if( node == null )
        throw new ArgumentNullException( "node" );

      if( group == null )
        throw new ArgumentNullException( "group" );

      if( groupLevelDescription == null )
        throw new ArgumentNullException( "groupLevelDescription" );

      if( dataGridContext == null )
        throw new ArgumentNullException( "dataGridContext" );

      m_collectionViewGroup = group;

      // Initialization is done through setters to register for events.
      this.DataGridContext = dataGridContext;
      this.GeneratorNode = node;
      this.GroupLevelDescription = groupLevelDescription;
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:25,代码来源:Group.cs

示例9: Visit

    public void Visit( DataGridContext sourceContext, int sourceDataItemIndex, object item, ref bool stopVisit )
    {
      if( !m_isTableFlowView )
      {
        m_item = item;
        m_parentDataGridContext = sourceContext;
        m_success = true;
        stopVisit = true;
        return;
      }

      UIElement dataRow = sourceContext.CustomItemContainerGenerator.ContainerFromItem( item ) as UIElement;

      if( dataRow != null )
      {
        if( !ScrollTip.IsItemInView( dataRow, sourceContext.DataGridControl.ItemsHost ) )
        {
          stopVisit = true;
        }
        else if( !ScrollTip.IsDataItemHiddenBySticky( sourceContext, item ) )
        {
          m_item = item;
          m_parentDataGridContext = sourceContext;
          m_success = true;
          stopVisit = true;
        }
      }
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:28,代码来源:ItemContextVisitor.cs

示例10: Visit

    public void Visit( DataGridContext sourceContext, ref bool stopVisit )
    {
      object[] items;
      CollectionView itemsCollection = sourceContext.Items;
      int count = itemsCollection.Count;

      if( count == 0 )
        return;

      if( sourceContext.ItemsSourceCollection is DataGridVirtualizingCollectionViewBase )
      {
        items = null;
      }
      else
      {
        items = new object[ count ];

        for( int i = 0; i < count; i++ )
        {
          items[ i ] = itemsCollection.GetItemAt( i );
        }
      }

      SelectionRange itemRange = new SelectionRange( 0, count - 1 );

      if( sourceContext.DataGridControl.SelectionUnit == SelectionUnit.Row )
      {
        sourceContext.DataGridControl.SelectionChangerManager.SelectItems(
          sourceContext,
          new SelectionRangeWithItems( itemRange, items ) );
      }
      else
      {
        HashedLinkedList<ColumnBase> columnsByVisiblePosition = sourceContext.ColumnsByVisiblePosition;
        SelectedItemsStorage selectedColumnStore = new SelectedItemsStorage( null, 8 );
        SelectionRange fullColumnRange = new SelectionRange( 0, columnsByVisiblePosition.Count - 1 );
        selectedColumnStore.Add( new SelectionRangeWithItems( fullColumnRange, null ) );
        int index = 0;

        foreach( ColumnBase column in columnsByVisiblePosition )
        {
          if( !column.Visible )
          {
            selectedColumnStore.Remove( new SelectionRangeWithItems( new SelectionRange( index ), null ) );
          }

          index++;
        }

        int columnRangeCount = selectedColumnStore.Count;

        for( int i = 0; i < columnRangeCount; i++ )
        {
          sourceContext.DataGridControl.SelectionChangerManager.SelectCells(
            sourceContext,
            new SelectionCellRangeWithItems( itemRange, items, selectedColumnStore[ i ].Range ) );
        }
      }
    }
开发者ID:wangws556,项目名称:duoduo-chat,代码行数:59,代码来源:SelectAllVisitor.cs

示例11: StartDataItem

        protected override void StartDataItem( DataGridContext dataGridContext, object dataItem )
        {
            if (!string.IsNullOrEmpty(_indentationString))
                WriteToBaseStream(_indentationString);

            // The next StartDataItemField will be considered as first column
            _isFirstColumn = true;
        }
开发者ID:rmunn,项目名称:cog,代码行数:8,代码来源:UnicodeCsvClipboardExporter.cs

示例12: Prepare

    internal void Prepare( DataGridContext dataGridContext, object dataItem )
    {
      m_containersPrepared = true;
      m_dataGridContext = dataGridContext;
      m_dataItem = dataItem;

      this.Update();
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:8,代码来源:DataGridItemContainerManager.cs

示例13: DataGridCurrentChangedEventArgs

 internal DataGridCurrentChangedEventArgs( DataGridContext oldDataGridContext, object oldCurrent, DataGridContext newDataGridContext, object newCurrent )
   : base( DataGridControl.CurrentChangedEvent )
 {
   this.OldDataGridContext = oldDataGridContext;
   this.OldCurrent = oldCurrent;
   this.NewDataGridContext = newDataGridContext;
   this.NewCurrent = newCurrent;
 }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:8,代码来源:DataGridCurrentChangedEvent.cs

示例14: Visit

    public void Visit( DataGridContext sourceContext, int startSourceDataItemIndex, int endSourceDataItemIndex, ref bool stopVisit )
    {
      SelectionManager selectionChangerManager = sourceContext.DataGridControl.SelectionChangerManager;

      if( m_selectedColumns != null )
      {
        int columnCount = sourceContext.Columns.Count;

        if( columnCount == 0 )
          return;

        SelectionRange contextColumnMaxRange = new SelectionRange( 0, columnCount - 1 );

        for( int i = 0; i < m_selectedColumns.Length; i++ )
        {
          SelectionRange selectionRange = m_selectedColumns[ i ];
          SelectionRange intersectionSelectionRange = selectionRange.Intersect( contextColumnMaxRange );

          if( intersectionSelectionRange.IsEmpty )
            continue;

#if DEBUG
          string action = ( m_unselect ) ? "Removing" : "Adding";
          Debug.WriteLine( "Selection : " + action + " cell : (" + startSourceDataItemIndex.ToString() + " - " + endSourceDataItemIndex.ToString() + ") - ("
             + intersectionSelectionRange.StartIndex.ToString() + " - " + intersectionSelectionRange.EndIndex.ToString() + ")" );
#endif

          var cellRange = new SelectionCellRangeWithItems( new SelectionRange( startSourceDataItemIndex, endSourceDataItemIndex ), null, intersectionSelectionRange );

          if( m_unselect )
          {
            selectionChangerManager.UnselectCells( sourceContext, cellRange );
          }
          else
          {
            selectionChangerManager.SelectCells( sourceContext, cellRange );
          }
        }
      }
      else
      {
#if DEBUG
        string action = ( m_unselect ) ? "Removing" : "Adding";
        Debug.WriteLine( "Selection : " + action + " Adding item : " + startSourceDataItemIndex.ToString() + " - " + endSourceDataItemIndex.ToString() );
#endif
        var itemRange = new SelectionRangeWithItems( new SelectionRange( startSourceDataItemIndex, endSourceDataItemIndex ), null );

        if( m_unselect )
        {
          selectionChangerManager.UnselectItems( sourceContext, itemRange );
        }
        else
        {
          selectionChangerManager.SelectItems( sourceContext, itemRange );
        }
      }
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:57,代码来源:RangeSelectionVisitor.cs

示例15: DataGridCurrentChangingEventArgs

 internal DataGridCurrentChangingEventArgs( DataGridContext oldDataGridContext, object oldCurrent, DataGridContext newDataGridContext, object newCurrent, bool isCancelable )
   : base( DataGridControl.CurrentChangingEvent )
 {
   this.IsCancelable = isCancelable;
   this.OldDataGridContext = oldDataGridContext;
   this.OldCurrent = oldCurrent;
   this.NewDataGridContext = newDataGridContext;
   this.NewCurrent = newCurrent;
 }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:9,代码来源:DataGridCurrentChangingEvent.cs


注:本文中的DataGridContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。