本文整理汇总了C#中ColumnCollection.AddColumns方法的典型用法代码示例。如果您正苦于以下问题:C# ColumnCollection.AddColumns方法的具体用法?C# ColumnCollection.AddColumns怎么用?C# ColumnCollection.AddColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColumnCollection
的用法示例。
在下文中一共展示了ColumnCollection.AddColumns方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Index
/// <summary>
/// Indexes the specified process name.
/// </summary>
/// <param name="processName">Name of the process.</param>
/// <param name="name">The name.</param>
/// <returns>ActionResult.</returns>
public ActionResult Index(string processName, string name)
{
var listType = GetListType(ref processName);
var methodName = string.Format(CultureInfo.InvariantCulture, "Get{0}List", processName);
var list = (IInfoList)MethodCaller.CallFactoryMethod(listType, methodName, "", 0, 10, null, FilterDescriptor.GetFilterExpression(null));
var columns = new ColumnCollection();
var baseType = list.GetType().BaseType;
if (baseType != null)
{
var itemType = baseType.GetGenericArguments()[1];
columns.AddColumns(itemType);
}
var listViewModel = new ListViewModel {Columns = columns, List = new List<dynamic>()};
foreach (var item in list)
listViewModel.List.Add(item);
listViewModel.OriginalList = list;
return View(listViewModel);
}
示例2: AddColumns
/// <summary>
/// Adds the columns.
/// </summary>
/// <param name="columns">The columns.</param>
/// <param name="itemType">Type of the item.</param>
/// <param name="owner">The owner.</param>
/// <param name="prefix">The prefix.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="forFilter">if set to <c>true</c> [for filter].</param>
/// <param name="displayColumns">The display columns.</param>
public void AddColumns(ColumnCollection columns, Type itemType, IPageableList owner, string prefix = null, string tableName = null, bool forFilter = false, string[] displayColumns = null)
{
columns.AddColumns(itemType, owner, prefix, tableName, forFilter, displayColumns);
}
示例3: GetFullColumnList
private IEnumerable<IColumnItem> GetFullColumnList(Type itemType, List<string> hiddenProps = null)
{
var result = new ColumnCollection();
result.AddColumns(itemType, SearchViewModel);
if (SearchViewModel.ProcessSystemName == Constants.AccountProcessName)
{
for (var i = result.Count - 1; i >= 0; --i)
{
if (result[i].FullName == "Password")
result.RemoveAt(i);
}
}
return result;
}