/* * public override CurrentItems FillDataRow() * { * CurrentItems ci = base.FillDataRow(); * DataRow row = this.Current as DataRow; * * if (row != null) { * CurrentItem c = null; * * foreach (DataColumn dc in table.Columns) * { * c = new CurrentItem(); * c.ColumnName = dc.ColumnName; * c.Value = row[dc.ColumnName]; * ci.Add(c); * } * } * return ci; * } */ public override CurrentItemsCollection FillDataRow() { CurrentItemsCollection ci = base.FillDataRow(); if (current != null) { CurrentItem c = null; foreach (PropertyDescriptor pd in this.listProperties) { c = new CurrentItem(); c.ColumnName = pd.Name; c.DataType = pd.PropertyType; c.Value = pd.GetValue(this.Current).ToString(); ci.Add(c); } } return(ci); }
public override CurrentItemsCollection FillDataRow() { CurrentItemsCollection ci = base.FillDataRow(); DataRow row = this.Current as DataRow; if (row != null) { CurrentItem c = null; foreach (DataColumn dc in table.Columns) { c = new CurrentItem(); c.ColumnName = dc.ColumnName; c.DataType = dc.DataType; c.Value = row[dc.ColumnName]; ci.Add(c); } } return(ci); }
public CurrentItemsCollection FillDataRow(int pos) { CurrentItemsCollection ci = new CurrentItemsCollection(); DataRow row = this.table.Rows[pos] as DataRow; if (row != null) { CurrentItem c = null; foreach (DataColumn dc in table.Columns) { c = new CurrentItem(); c.ColumnName = dc.ColumnName; c.DataType = dc.DataType; c.Value = row[dc.ColumnName]; ci.Add(c); } } return(ci); }