Give these two classes (forgive me for any bad syntax) for the sake of the issue:
public class Pencil{ public int Length { get; set; } public bool IsMechanical { get; set; }}
public class PencilCase{ private BindingList<Pencil> _pencils = new BindingList<Pencil>(); public int Color { get;set; } public BindingList<Pencil> Pencils {get; set; }}
Imagine binding a 'BindingList<PencilCase>' to a grid and that BindingList is empty (meaning zero items in it and not null). I can see that I have a single column in the first band (that column being Color) and another band called Pencils. In that second band I cannot see the columns that make up Pencil's properties. Shouldn't I be able to see 'Length' and 'IsMechanical' in that second band?
My problem is that I'm trying to format the way the columns look once after the list had been bound to the grid. I can format the looks of the band 0 but I can't seem to forumat the columns for band 1 because those columns don't seem to be there.
Thanks for any help :)
Gally
Gally,
I think that this has to do with the fact that since there are no rows, and especially that there is no child row in the first parent row, the .NET BindingManager is unable to determine the structure of the data, so the grid cannot properly get the columns. The two workarounds that I can think of are to either add rows to your data, or implement ITypedList on the Pencil class.
-Matt