Hi Guys,
I am trying to figure out if what I am trying to do is possible. Basically I have a scenario where the ListView Itemsource List I create is of a class type whose properties can only be determined at run time.
class DynamicClass{
=> Properties of this class needs to be set runtime
}
DynamicClass lstDynamicClass = new List<DynamicClass>();
...
while (sqlSqliteDataReader.Read())
{
DynamicClass fptDynamicClass = new DynamicClass ();
fptDynamicClass.PropA= sqlSqliteDataReader.GetString(sqlSqliteDataReader.GetOrdinal("ColA"));
fptDynamicClass.PropB= sqlSqliteDataReader.GetString(sqlSqliteDataReader.GetOrdinal("ColB"));
lstDynamicClass.Add(fptDynamicClass);
}
...
ListView.ItemSource = lstDynamicClass
Has anyone run into this kind of situation? If yes, it would be great to know how you handled it?
If there is a completely different way of handling this sort of scenario then please share your idea. Thanks.