當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。