all groups > dotnet windows forms databinding > june 2005 >
You're in the

dotnet windows forms databinding

group:

Bind my own domain classes like a DataSet to GridView in Designer


Re: Bind my own domain classes like a DataSet to GridView in Designer Norbert Ruessmann
6/24/2005 12:00:00 AM
dotnet windows forms databinding: Thanks for the answer.
But I forgot to metion that I use VS 2003 and .NET 1.1, and as far as I know
the data sources window is a new feature of VS2005/.NET2.0

Regards
Norbert Ruessmann

"Rockford Lhotka" <rocky.spambad@lhotka.net> schrieb im Newsbeitrag
news:efq0XIMeFHA.688@TK2MSFTNGP14.phx.gbl...
[quoted text, click to view]

Re: Bind my own domain classes like a DataSet to GridView in Designer Rockford Lhotka
6/24/2005 8:40:10 AM
You don't actually need to implement IComponent. All you should need to do
is add your class(es) as a data source using the Data Sources window.

Once your classes are available as data sources, you can drag-drop them onto
a form or otherwise use them like any other data source within the IDE.

Rocky
rocky.spambad@lhotka.net


[quoted text, click to view]

Bind my own domain classes like a DataSet to GridView in Designer Norbert Ruessmann
6/24/2005 11:43:01 AM
Hello group,
I developed some Domain classes , which are NOT a not related to DataSet /
DataTable etc. in any way. But they provide similar featurs.

A object can for instance contain a collection of Orders, plus a collection
of OrderItems. The collection of Orders contains Orders. Each Order has a
property OrderItems, which returns a collections of OrderItems. This
collection only contains the OrderItems blonging to the corresponding Order
(one to many relation)

From code data binding works perfectly. I can write:

dataGridOrders.DataSource = m_Orders; // instance of Orders Collection
dataGridItems.DataSource = m_Orders;
dataGridItems.DataMember = "OrderItems"; // name of property of Orders class

Thus I can display master/detail relations very easily, just as if I had
used a DataSet with two tables and a relation object.

Now my Question: I would like to specify DataSource and DataMember in the
Properties Windows of the DataGrid in VS designer, just like I can do with a
typed DataSet. I made my class implement IComponent, thus I can set the
DataSource. But what do I have to implement in my class to be able to
specify the DataMember in designer????
I searched MSDN and the internet for two days now, but could not find any
information on how to do this.


Regards
Norbert Ruessmann

Re: Bind my own domain classes like a DataSet to GridView in Designer Norbert Ruessmann
6/28/2005 11:41:43 AM
In the meantime I tried with VS2005 Beta. I can bind my Control to a
DataGridView (and even use the column editor), but in the DataMember
property the chilkd collections do not show up for the one to many
relations.

Does anybody have any idea? In the meantime I have the impression that the
DataGrid (VS2003) and DataGridView (VS2005) at design time only work with
DataSets, and nothing else.

Regards
Norbert Ruessmann

"Rockford Lhotka" <rocky.spambad@lhotka.net> schrieb im Newsbeitrag
news:efq0XIMeFHA.688@TK2MSFTNGP14.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button