I got a class and i’m try to fill the datgaridview as generic list. I got a problem in dapuConfigs.CoveredLaneswhich is a list and i tried to access the list and fill it in the datagridview i coulmdn’t succeed. May be both of approach is wrong here…!
Please help me??
When i run, i’m getting a text appears in the grid cell: system colelction generic list.
Added code :
.ForEach(
Configs =>
{
{
datagridview1.Rows.Add(
new object[]
{
Configs.Id,
Configs.Description,
Configs.Covered.ElementAtOrDefault(0).Id == null ? "" : Configs.Covered.ElementAtOrDefault(0).Id.ToString(),
Configs.Covered.ElementAtOrDefault(1).Id == null ? "" : Configs.Covered.ElementAtOrDefault(1).Id.ToString(),
Configs.Covered.ElementAtOrDefault(2).Id == null ? "" : Configs.Covered.ElementAtOrDefault(2).Id.ToString(),
Configs.Covered.ElementAtOrDefault(3).Id == null ? "" : Configs.Covered.ElementAtOrDefault(3).Id.ToString(),
});
}
});
So, where you have
in your first example, try changing to:
Or, for matching on Id
or more general match on id…
andd adding a check for no match…