D
David Elliott
I am trying to get data from a CollectionBase derived class into a ListView.
Currently the output is one continuous line of data that is of Boolean type
e.g. True True False True False False False True .
No other data or header information is displayed.
public class RecFormCtxSaved
{
private Boolean enabled;
private Boolean selected;
private string column;
private string text;
}
private void createListView()
{
ListViewItem lvi;
this.listView1.Columns.Add("Enable", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Select", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Column", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Text", 50, HorizontalAlignment.Left);
foreach (RecFormCtxSaved rec in coll)
{
lvi = new ListViewItem();
lvi.Text = rec.Enabled.ToString();
lvi.SubItems.Add(rec.Selected.ToString());
lvi.SubItems.Add(rec.Column);
lvi.SubItems.Add(rec.Text);
this.listView1.Items.Add(lvi);
}
}
Currently the output is one continuous line of data that is of Boolean type
e.g. True True False True False False False True .
No other data or header information is displayed.
public class RecFormCtxSaved
{
private Boolean enabled;
private Boolean selected;
private string column;
private string text;
}
private void createListView()
{
ListViewItem lvi;
this.listView1.Columns.Add("Enable", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Select", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Column", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Text", 50, HorizontalAlignment.Left);
foreach (RecFormCtxSaved rec in coll)
{
lvi = new ListViewItem();
lvi.Text = rec.Enabled.ToString();
lvi.SubItems.Add(rec.Selected.ToString());
lvi.SubItems.Add(rec.Column);
lvi.SubItems.Add(rec.Text);
this.listView1.Items.Add(lvi);
}
}