本文整理汇总了C#中TableCell.ApplyStyle方法的典型用法代码示例。如果您正苦于以下问题:C# TableCell.ApplyStyle方法的具体用法?C# TableCell.ApplyStyle怎么用?C# TableCell.ApplyStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableCell
的用法示例。
在下文中一共展示了TableCell.ApplyStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertGridRow
/// <summary>
/// Inserts a grid row. Only cells required for the summary results
/// will be created (except if GenerateAllCellsOnSummaryRow is true).
/// The group will be checked for columns with summary
/// </summary>
/// <param name="beforeRow"></param>
/// <param name="g"></param>
/// <returns></returns>
private GridViewRow InsertGridRow(GridViewRow beforeRow, GridViewGroup g)
{
int colspan;
TableCell cell;
TableCell[] tcArray;
int visibleColumns = this.GetVisibleColumnCount();
Table tbl = (Table)mGrid.Controls[0];
int newRowIndex = tbl.Rows.GetRowIndex(beforeRow);
GridViewRow newRow = new GridViewRow(newRowIndex, newRowIndex, DataControlRowType.DataRow, DataControlRowState.Normal);
if ( g != null && ( g.IsSuppressGroup || g.GenerateAllCellsOnSummaryRow ) )
{
// Create all the table cells
tcArray = new TableCell[visibleColumns];
for (int i = 0; i < visibleColumns; i++)
{
cell = new TableCell();
cell.ApplyStyle(mGrid.Columns[GetRealIndexFromVisibleColumnIndex(i)].ItemStyle);
cell.Text = " ";
tcArray[i] = cell;
}
}
else
{
// Create only the required table cells
colspan = 0;
List<TableCell> tcc = new List<TableCell>();
for (int i = 0; i < mGrid.Columns.Count; i++)
{
if (ColumnHasSummary(i, g))
{
if (colspan > 0)
{
cell = new TableCell();
cell.Text = " ";
cell.ColumnSpan = colspan;
tcc.Add(cell);
colspan = 0;
}
// insert table cell and copy the style
cell = new TableCell();
cell.ApplyStyle(mGrid.Columns[i].ItemStyle);
tcc.Add(cell);
}
else if (mGrid.Columns[i].Visible)
{
// A visible column that will have no cell because has
// no summary. So we increase the colspan...
colspan++;
}
}
if (colspan > 0)
{
cell = new TableCell();
cell.Text = " ";
cell.ColumnSpan = colspan;
tcc.Add(cell);
colspan = 0;
}
tcArray = new TableCell[tcc.Count];
tcc.CopyTo(tcArray);
}
newRow.Cells.AddRange(tcArray);
tbl.Controls.AddAt(newRowIndex, newRow);
return newRow;
}