本文整理汇总了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;
}
示例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;
}