MappingName for Windows Forms DataGrid

MappingName for Windows Forms DataGrid

Old forum URL: forums.lhotka.net/forums/t/968.aspx


ktweedy posted on Monday, August 21, 2006

I am trying to make my own TableStyle for a DataGrid.  It isn't being used, instead it seems to be using the default TableStyle and auto creating the columns.  I beleive it is because i am not setting the correct MappingName.

This works but it doesn't use my custom TableStyles.

 dataGrid1.SetDataBinding(account.MyDetailCollection(), "");

I have tried using the parent and child class names like the following but I get an error "Cannot create a child list for field".

dataGrid1.SetDataBinding(account.MyDetailCollection(), "BOMyDetail");

 

ktweedy replied on Tuesday, August 22, 2006

In case someone needs it I figured it out.

I got this to work and use my styles.

myTableStyle.MappingName   = "MyDetailCollection"  // Need to use the Class name

...rest of TableStyle code

MyDetailCollection myDetailCollection   = MyDetailCollection.GetCollection();

dataGrid1.DataSource = myDetailCollection;

Copyright (c) Marimer LLC