コード例 #1
0
 public override DataGridColumnsPage.ColumnItem[] CreateColumns(PropertyDescriptorCollection fields)
 {
     ArrayList list = new ArrayList();
     IEnumerator enumerator = fields.GetEnumerator();
     while (enumerator.MoveNext())
     {
         PropertyDescriptor current = (PropertyDescriptor) enumerator.Current;
         if (BaseDataList.IsBindableType(current.PropertyType))
         {
             BoundColumn runtimeColumn = new BoundColumn {
                 HeaderText = current.Name,
                 DataField = current.Name
             };
             DataGridColumnsPage.ColumnItem item = new DataGridColumnsPage.BoundColumnItem(runtimeColumn);
             item.LoadColumnInfo();
             list.Add(item);
         }
     }
     return (DataGridColumnsPage.ColumnItem[]) list.ToArray(typeof(DataGridColumnsPage.ColumnItem));
 }
コード例 #2
0
 public override DataGridColumnsPage.ColumnItem CreateColumn()
 {
     BoundColumn runtimeColumn = new BoundColumn();
     if (!this.genericBoundColumn)
     {
         runtimeColumn.HeaderText = this.fieldName;
         runtimeColumn.DataField = this.fieldName;
         runtimeColumn.SortExpression = this.fieldName;
     }
     DataGridColumnsPage.ColumnItem item = new DataGridColumnsPage.BoundColumnItem(runtimeColumn);
     item.LoadColumnInfo();
     return item;
 }