This is an interesting solution. I would like to ask also ... if I had many
"Nicolas L." wrote:
> Users table is in a relation 1-to-many with Orders, so if you want to add
> First and Last Name of Users to Orders,
> you could add one more DataColumn to table Orders and set the expression to:
>
> Dim dcFullName As DataColumn
>
> ' Create the column.
> dcFullName = New DataColumn
> With dcFullName
> .DataType = System.Type.GetType("System.String")
> .ColumnName = "FullName"
> .Expression = "Parent.FirstName + Parent.LastName"
> End With
>
> myDataSet.Table("Orders").Columns.Add(dcFullName)
>
> Don't forget to include the "Parent." in the expression because you're
> referring a parent table from its child, to refer a child from its parent
> you must antepone "Child." to the column name. For a complete use of
> DataColumn.Expression Property go to:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatacolumnclassexpressiontopic.asp
>
> Nicolas L.
>
> "Oleg Ogurok" <oleg@ogurok.com.ihatespammers.ireallydo.co> escribió en el
> mensaje news:10s24epfut03vfe@corp.supernews.com...
> > Hi all,
> >
> > I have a strongly typed dataset with tables:
> > Users: ID, First Name, LastName
> > Orders: ID, Quantity, UserID
> >
> > UserID is related to Users' ID column via a DataRelation.
> >
> > I'm binding Orders table to a DataGrid, and one of the columns I need to
> > be the First+Last name of the corresponding user.
> > How can I accomplish it?
> >
> > I tried adding a DataGridColumnStyle and setting MappingProperty to bunch
> > of different values but none worked.
> >
> > Also, any tutorials on DataGrid are gladly appreciated.
> > Thanks.
> > -Oleg.
> >
> >
>
>