I have a data source with related tables.
In the presentation of the data in the UltraGrid I would like then to see them on the same line.
for example I have article assortment lines with a related one article, one related product form and one related packing size.
In the UltraGrid it is displayed based on the data source definition:
One assortment article line with 3 sub lines for the article, the product form and the packing size.
How can I adjust this so the grid shows one line for this and the some fields from the article, the product form and the packing size are visually integrated in the article assortment line?
For updated of this line the article, Product form and packing size should become select-able from the related sub tables?
Who can help me on this?
Kind regards,
Peter Wokke
Hi Peter,
There are two ways that you can accomplish this. The first is to create a custom view in your data and binding to that view. This is probably the easiest way and I recommend taking this approach.
If you can't touch the data source directly, you can use unbound columns to create the effect of a custom view. Add an unbound column for each field that you want to add, then loop through the grid's rows and look up the data in your data source. I have included a sample that demonstrates how you can set this up.
Hello Mike,
Thank you for your reply and the examples.
I see the and understand the CreateUnboundColumn methode. (Form1.cs)
Have to translate this in Progress OpenEdge Visual Developer Studio approach.
The first option with the custom view is not clear to me (this is in Form1.Designer.cs?).
Is it set as a Group option into the grid? how to relate it to the different band levels in the same grid?
This is the dataset definition I use in the datading source the Ultra grid is linked to:
The first data-relation is the master group BAND(0) in the grid.
The second is first record group of it BAND(1) in the grid. This one has three relations for the ArticleID, ProductFormCode and PackingCode BANDs(2,3,4) in the grid.
These three should be integrated in the presentation of the ArticleAssortment line.
In the custom view do I have to hidde bands and assign colums of these hidden bands to display in the related band?
{Delivery/Definitions/ttArticleAssortment.i {&*}}{Delivery/Definitions/ttAssortmentGroup.i {&*}}{Delivery/Definitions/ttArticle.i {&*}}{Delivery/Definitions/ttProductForm.i {&*}}{Delivery/Definitions/ttPacking.i {&*}}{Delivery/Definitions/ttAssortmentPacking.i {&*}}{Delivery/Definitions/ttPackingAlternative.i {&*}}{Delivery/Definitions/ttProductFormAlternative.i {&*}}
define {&ClassAccess} dataset dsAuctionSupplierAssortment{&Buffer} {&reference-only} for ttAssortmentGroup{&Buffer}, ttArticleAssortment{&Buffer}, ttArticle{&Buffer}, ttProductForm{&Buffer}, ttPacking{&Buffer}, ttAssortmentPacking{&Buffer}, ttPackingAlternative{&Buffer}, ttProductFormAlternative{&Buffer} data-relation ttAssortmentGroup-ttArticleAssortment for ttAssortmentGroup{&Buffer}, ttArticleAssortment{&Buffer} relation-fields(AssortmentGroup,AssortmentGroup) data-relation ttArticleAssortment-ttArticle for ttArticleAssortment{&Buffer}, ttArticle{&Buffer} relation-fields(ArticleID,ArticleID) data-relation ttArticleAssortment-ttProductForm for ttArticleAssortment{&Buffer}, ttProductForm{&Buffer} relation-fields(ProductFormCode,ProductFormCode) data-relation ttArticleAssortment-ttPacking for ttArticleAssortment{&Buffer}, ttPacking{&Buffer} relation-fields(PackingCode,PackingCode) data-relation ttArticleAssortment-ttAssortmentPacking for ttArticleAssortment{&Buffer}, ttAssortmentPacking{&Buffer} relation-fields(AssortmentCode,AssortmentCode,ProductFormCode,ProductFormCode,AssortmentGroup,AssortmentGroup) data-relation ttAssortmentPacking-ttPackingAlternative for ttAssortmentPacking{&Buffer}, ttPackingAlternative{&Buffer} relation-fields(PackingCode,PackingCode) data-relation ttAssortmentPacking-ttProductFormAlternative for ttAssortmentPacking{&Buffer}, ttProductFormAlternative{&Buffer} relation-fields(ProductFormCode,ProductFormCode) . /* stop */
For the first option with a custom view, I am suggesting that (if possible) you should modify your data source itself to include a new view. This way the data is represented in the same way that you want to display it, and most of the setup is done by the time you create the form. If you need to hide any columns, this could still be done on the grid -- although it may be simpler to exclude them from this view.
I recognize that you may be restricted from modifying the data source, so I presented the second option. If you find that this option better suits your needs, then please implement it in this way.