本文整理汇总了C#中ColumnCollection.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# ColumnCollection.Clear方法的具体用法?C# ColumnCollection.Clear怎么用?C# ColumnCollection.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColumnCollection
的用法示例。
在下文中一共展示了ColumnCollection.Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _BuildColumnsCollection
/// <summary>
/// Builds collection of columns.
/// </summary>
/// <param name="columns"></param>
private void _BuildColumnsCollection(ColumnCollection columns)
{
columns.Clear();
foreach (Column column in _columns)
{
if (column.FieldName.Equals("Capacities") || column.FieldName.Equals("CustomOrderProperties"))
{
Collection<Column> dynamicColumns = column.FieldName.Equals("Capacities") ?
_GetDynamicCapacitiesColumns(column.ReadOnly) :
_GetDynamicCustomOrderColumns(column.ReadOnly);
foreach (Column dynamicColumn in dynamicColumns)
{
if (column.CellEditor != null)
dynamicColumn.CellEditor = column.CellEditor;
dynamicColumn.Width = column.Width;
columns.Add(dynamicColumn);
}
}
else if (column.FieldName.Equals("AddressFields"))
{
Collection<Column> dynamicColumns = _GetDynamicAddressColumns(column.ReadOnly);
foreach (Column dynamicColumn in dynamicColumns)
columns.Add(dynamicColumn);
}
else
columns.Add(column);
}
}
示例2: _BuildColumnsCollection
/// <summary>
/// Builds collection of columns.
/// </summary>
/// <param name="parametersCount">Parameters count.</param>
/// <param name="readedColumns">Readed columns.</param>
/// <param name="columns">Colums.</param>
private void _BuildColumnsCollection(int parametersCount,
ArrayList readedColumns,
ColumnCollection columns)
{
Debug.Assert(null != readedColumns);
Debug.Assert(null != columns);
columns.Clear();
foreach (Column column in readedColumns)
{
if (!column.FieldName.Equals(DYNAMIC_FIELDS_ALIAS))
columns.Add(column);
else
{
string parameterColumnTitleFormat =
App.Current.FindString("ParameterColumnHeaderFormat");
for (int index = 0; index < parametersCount; ++index)
{
var col = new Column();
col.FieldName = _GetDynamicFieldName(index);
col.Title = string.Format(parameterColumnTitleFormat,
(0 == index) ? "" : (index + 1).ToString());
col.CellContentTemplate = column.CellContentTemplate;
col.CellEditor = column.CellEditor;
col.Width = column.Width;
col.MinWidth = column.MinWidth;
col.MaxWidth = column.MaxWidth;
col.CellValidationRules.Add(new ParameterValidationRule());
columns.Add(col);
}
}
}
}