> I have successfully used custom collections as the datasource for a datagrid
> previously however this one is causing me problems as one of the properties
> of the objects within the collection relate to another custom object as
> follows
> I have a collection that inherits CollectionBase called
> OrderNumberCollection that I can add individual OrderNumber objects to and
[quoted text clipped - 9 lines]
>
> Any thoughts welcomed !
If your on Framework 2.0 I'd suggest to switch to a datagridview and
handle the Format event:
Event: datagridview.Format
in the EventHandler you can set the Value in the from the EventArgs (e):
e.Value = ((OrderType)e.Value).Description
(sorry, my notation is c# as I don't know VB well, hope to give you some
input anyways).
Markus
Stephen Ritchie - 21 Feb 2006 16:00 GMT
Markus
Thanks for the reply, however I am not on NET 2.0. Any other possibilities ?
> > I have successfully used custom collections as the datasource for a datagrid
> > previously however this one is causing me problems as one of the properties
[quoted text clipped - 27 lines]
>
> Markus
Markus - 21 Feb 2006 19:02 GMT
> Thanks for the reply, however I am not on NET 2.0. Any other
> possibilities ?
Very sad, as the 2.0 version brings a lot of new features to the
DataGrid and the new DataGridView.
However, what you can try is to define custom Columns in the grid, e.g.
suitable for you might be the DataGridTextBoxColumn. It provides a
Property "Format" and "FormatInfo" where you can set any custom
IFormatProvider and a Format String.
Additionally the DataGridTextBoxColumn has the Methods
"SetColumnValueAtRow" and "GetColumnValueAtRow", maybe they are useful...
however, I have not tested anything of the above, but good luck and
sorry, I can't provide more informations.
Markus