Displaying child row information in a cell
Lets say I have a ''parent'' table A:
with cols x, y and z
and a ''child table'' B
with cols a, b, z
A.z is a constraint to B.z
I.e. table A owns the row in table B with a key of z
I want to display in a grid the 4 columns
A.x, A.y, B.a, B.b
How can I do this?
There is a similar example GDBGCombos which does somethign similar but I dont want a combobox. i just want to display the field.
Also ideally I''d like to write a formatter for that column to display only 3 columns and concatenate B.a and B.b together.
A.x, A.y, B.a + " is " + B.b
How should I proceed?
SIGN IN To post a reply.
6 Replies
AD
Administrator
Syncfusion Team
January 28, 2004 08:37 AM UTC
You can do this in QueryCellFormattedText. Here is a sample.
AD
Administrator
Syncfusion Team
January 28, 2004 07:03 PM UTC
Great, thanks a lot for creating this sample for me. I''ve got everything up and running as I want it.
One related question though: is it possible to reference a child column in the DataMember using some kind of . notation ?
i.e.
gridColumn.Style.DataSource = ....;
gridColumn.Style.CellType = "Static";
gridColumn.DataMember = "Customers.CustomerName";
gridColumn.DataValue = "customerID";
Now i know this particular example is probably not even logically complete but you get the idea of what i''m looking for.
I seem to remember that .net grids can do something like this although it was never functionality i had a great need for so I am not certain.
>You can do this in QueryCellFormattedText. Here is a sample.
>
>
AD
Administrator
Syncfusion Team
January 28, 2004 08:38 PM UTC
I think if you want to do this, then the style.DataSource would have to be the DataSet that held the Customers table and you would have to define the ValueMember using the same scheme.
AD
Administrator
Syncfusion Team
January 28, 2004 08:54 PM UTC
The .NET property i was implicitly replying to was DataColumn.Expression
http://www.nedcomp.nl/support/origdocs/dotnetsdk/cpref/frlrfsystemdatadatacolumnclassexpressiontopic.htm?ntp=1
If there is no equivalent support in syncfusion then that fine, I already have what i want working but just wanted to make sure I hadnt missed the support if it was hiding somewhere.
AD
Administrator
Syncfusion Team
January 28, 2004 08:54 PM UTC
perhaps i should be looking at FormulaCells
>The .NET property i was implicitly replying to was DataColumn.Expression
>
>http://www.nedcomp.nl/support/origdocs/dotnetsdk/cpref/frlrfsystemdatadatacolumnclassexpressiontopic.htm?ntp=1
>
>If there is no equivalent support in syncfusion then that fine, I already have what i want working but just wanted to make sure I hadnt missed the support if it was hiding somewhere.
AD
Administrator
Syncfusion Team
January 28, 2004 09:04 PM UTC
You would add an expression column to the DataTable before you set the DataTable as the datasource for the combobox. Once you do this, then you can use the column name of the expression column as the DisplayMember for the combobox.
SIGN IN To post a reply.
- 6 Replies
- 2 Participants
-
SI simon
- Jan 28, 2004 01:46 AM UTC
- Jan 28, 2004 09:04 PM UTC