I recently tried to add a ObjectListView to my project instead of the normal ListView. But i can not add the Items or the SubItems to the ObjectListView. The ObjectListView is always empty when i try to fill it with this code:
while (dr.Read())
{
OLVListItem item = new OLVListItem(dr["tn"].ToString());
item.SubItems.Add(dr["title"].ToString());
item.SubItems.Add(tickettime.ToString());
item.SubItems.Add(Convert.ToDateTime(dr["date"]).ToString("dd.MM.yyyy"));
item.SubItems.Add(dr["schlange"].ToString());
item.SubItems.Add(dr["vorname"].ToString() + " " + dr["nachname"].ToString());
Objectlistview.AddObject(item);
}
can you please help me or send me some useful commands to add subitems or items generally.