We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

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?

6 Replies

AD Administrator Syncfusion Team January 28, 2004 03:37 AM

You can do this in QueryCellFormattedText. Here is a sample.


AD Administrator Syncfusion Team January 28, 2004 02:03 PM

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 03:38 PM

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 03:54 PM

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 03:54 PM

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 04:04 PM

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.

Loader.
Live Chat Icon For mobile
Up arrow icon