本文整理匯總了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;
}