IDwMeta.Columns Property
.NET Standard 2.x
Gets the column controls in the DataWindow.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
IMetaList<IColumnMeta> Columns { get; }
Return
DWNet.Data.IMetaList<IColumnMeta>
The column controls in the DataWindow.
Examples
The following code example demonstrates how to use the Columns property.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IDwMetaExamples
{
public class ColumnsExample
{
private readonly SchoolContext _context;
public ColumnsExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example()
{
// Instantiates datastore with datawindow: d_department
var datastore = new DataStore("d_department", _context);
datastore.Retrieve();
// Gets the properties of the Columns.
var columnMetas = datastore.DwMeta.Columns;
Console.WriteLine("Columns Count: {0}", columnMetas.Count);
// Gets the zero-based ID of the column.
for (int i = 0; i < columnMetas.Count; i++)
{
Console.WriteLine("Column Name: {0}; ID: {1}",
columnMetas[i].Name, columnMetas[i].ID);
}
// Gets the appearance and behavior properties of the first column.
var dwDddw = columnMetas[0].Dddw;
Console.WriteLine("HScrollBar: {0}", dwDddw.HScrollBar);
Console.WriteLine("VScrollBar: {0}", dwDddw.VScrollBar);
/*This code produces the following output:
Columns Count: 5
Column Name: Departmentid; ID: 0
Column Name: Name; ID: 1
Column Name: Budget; ID: 2
Column Name: Startdate; ID: 3
Column Name: Administrator; ID: 4
HScrollBar: false
VScrollBar: false
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x