Chris <(E-Mail Removed)> wrote:
> Michael Kellogg wrote:
>> I have a collection of objects that I am trying to display in a
>> Windows Forms Datagrid. I have had problems doing this before, so
>> the first time around I went and did a Grid.TableStyles.Clear before
>> naming my collection as the DataSource.
>>
>> In this scenario, the collection's members come up perfect in the
>> datagrid, but I have no control over the look of it. So I added a
>> TableStyle and a GridColumnStyle object in the designer, giving the
>> names of my collection's object's members as the MappingName property
>> for each column. I left the MappingName of the TableStyle blank. I
>> also got rid of the "TableStyles.Clear" line.
>>
>> In short, nothing different happens. Everything loads in as though
>> there were no tablestyle defined. Can anyone tell me why, and how to
>> make my tablestyle appear?
>>
>
> It's because it doesn't which tablestyle to use. You need to name the
> tablestyle.mappingname to the name of your collection.
Thanks for the pointer. I had messed with that earlier but couldn't get
anything to change. The name of my datasource was "m_doc.EntryPoints"; I
tried that name, and I'd tried "EntryPoints", neither of which had any
effect. I just now tried "Collection" and VOILA... Bizarre.
--
Michael
|