本文整理汇总了C#中DataGridCell.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridCell.SetValue方法的具体用法?C# DataGridCell.SetValue怎么用?C# DataGridCell.SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataGridCell
的用法示例。
在下文中一共展示了DataGridCell.SetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformCellLayout
private void PerformCellLayout(double leftEdge, DataGridColumnBase dataGridColumn, DataGridCell cell, bool isCellFrozen)
{
Debug.Assert(cell != null);
Debug.Assert(this._cellsElement != null);
Debug.Assert(this.OwningGrid != null);
if (leftEdge < this.OwningGrid.CellsWidth)
{
if (isCellFrozen)
{
cell.Visibility = Visibility.Visible;
cell.SetValue(Canvas.LeftProperty, leftEdge);
cell.SetValue(Canvas.ZIndexProperty, 1);
cell.Width = dataGridColumn.Width;
cell.Height = this._cellsElement.Height;
RectangleGeometry rg = new RectangleGeometry();
rg.Rect = new Rect(0, 0, cell.Width, cell.Height);
cell.Clip = rg;
}
else
{
if (this.OwningGrid.DisplayData.FirstDisplayedScrollingCol == dataGridColumn.Index &&
this.OwningGrid.FirstDisplayedScrollingColumnHiddenWidth > 0 &&
dataGridColumn.Width <= this.OwningGrid.FirstDisplayedScrollingColumnHiddenWidth)
{
cell.Visibility = Visibility.Collapsed;
}
else
{
cell.Visibility = Visibility.Visible;
cell.SetValue(Canvas.LeftProperty, leftEdge);
cell.Width = dataGridColumn.Width;
cell.Height = this._cellsElement.Height;
RectangleGeometry rg = new RectangleGeometry();
if (this.OwningGrid.DisplayData.FirstDisplayedScrollingCol == dataGridColumn.Index && this.OwningGrid.FirstDisplayedScrollingColumnHiddenWidth > 0)
{
rg.Rect = new Rect(this.OwningGrid.FirstDisplayedScrollingColumnHiddenWidth, 0, cell.Width - this.OwningGrid.FirstDisplayedScrollingColumnHiddenWidth, cell.Height);
}
else
{
rg.Rect = new Rect(0, 0, cell.Width, cell.Height);
}
cell.Clip = rg;
}
}
}
else
{
cell.Visibility = Visibility.Collapsed;
}
}