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


C# DataGridControl.GetContainerFromIndex方法代码示例

本文整理汇总了C#中Xceed.Wpf.DataGrid.DataGridControl.GetContainerFromIndex方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridControl.GetContainerFromIndex方法的具体用法?C# DataGridControl.GetContainerFromIndex怎么用?C# DataGridControl.GetContainerFromIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Xceed.Wpf.DataGrid.DataGridControl的用法示例。


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

示例1: GetListViewItem

        Row GetListViewItem(int index, DataGridControl lvObject)
        {
            //if (lvObject.ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated)
            //    return null;

            //return lvObject.ItemContainerGenerator.ContainerFromIndex(index) as ListViewItem;
            return lvObject.GetContainerFromIndex(index) as Row;
        }
开发者ID:erwin-hamid,项目名称:LogPro,代码行数:8,代码来源:QueriesView.xaml.cs

示例2: ProcessFirstVisibleContainer

    private static FrameworkElement ProcessFirstVisibleContainer( 
      DataGridControl gridControl,
      double offset,
      double viewportSize,
      double opposedOffset,
      double opposedViewportSize,
      Orientation panelOrientation )
    {
      FrameworkElement retval = null;

      // Only needed if the DataGridControl contains items
      if( ( gridControl != null ) && ( gridControl.Items.Count > 0 ) )
      {
        bool qualifyingContainerFound = false;

        //retrieve the last object index according to item scrolling axis (this covers both the "Vertical and None" primary axis cases... 
        //as well as default if no other row matches the PrimaryAxis criteria)
        int runningIndex = ( int )( offset );

        //cycle for as long as a qualifying container is not found.
        while( !qualifyingContainerFound )
        {
          retval = gridControl.GetContainerFromIndex( runningIndex ) as FrameworkElement;

          //will be reverted back if the container does not match a particular condition.
          if( retval != null )
          {
            qualifyingContainerFound = ScrollViewerHelper.IsContainerQualifying( retval,
              gridControl,
              offset,
              viewportSize,
              opposedOffset,
              opposedViewportSize,
              panelOrientation );
          }

          //under all circumstances, if I am back at the end of the viewport ( last item visible), then have it qualify.
          if( runningIndex == ( offset + viewportSize - 1 ) )
            qualifyingContainerFound = true;

          runningIndex++;
        }
      }

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


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