I have the following shape statement:
SHAPE {SELECT tblProduct.ProductID, tblProduct.ProductRef, tblProduct.ProductName, tblProductCat.ProductCatID, tblProductCat.ProductCatName FROM tblProduct INNER JOIN tblProductCat ON tblProduct.ProductCatID = tblProductCat.ProductCatID WHERE tblProductCat.ProductCatName = 'Food Box'} AS BOMTop APPEND ((SHAPE {SELECT * FROM tblBOMDet} AS BOMDet APPEND ({SELECT tblBOMDetDet.BOMDetID, tblProduct.ProductRef, tblProduct.ProductName, tblProductCat.ProductCatName, tblBOMDetDet.Priority, tblBOMDetDet.Comment, tblProduct_1.ProductRef AS [Make From Product], tblProduct_1.ProductName AS [Make From Desc], tblProductCat_1.ProductCatName AS [Make From ProductCat]
FROM (((tblBOMDetDet INNER JOIN tblProduct ON tblBOMDetDet.ProductID = tblProduct.ProductID) INNER JOIN tblProductCat ON tblBOMDetDet.ProductCatID = tblProductCat.ProductCatID) LEFT JOIN tblProduct AS tblProduct_1 ON tblBOMDetDet.MakeFromProductID = tblProduct_1.ProductID) LEFT JOIN tblProductCat AS tblProductCat_1 ON tblBOMDetDet.MakeFromProductCatID = tblProductCat_1.ProductCatID} AS BOMDetDet
RELATE 'BOMDetID' TO 'BOMDetID') as OrderDetGrant) as BOMDet RELATE 'ProductID' TO 'ParentProductID') as BOMDet
Problem is that the old SSUltragrid we used to use not display any of the as headings. The new grid is displaying OrderDetGrant, BOMDet and some others that were not there. To hide these I could append to the end of each "ID" that forces out grids to hide these columns but that would require a huge amount of work to hide all of the columns. Is there a grid setting that will suppress this behavior or is something else wrong?
Thank you for the help.
Johauna.
Did you ever get anywhere with this problem? I too have been replacing 'UltraGrid' with 'UltraWinGrid' and the heirical stuff is annoying.
The old grid DID hide 'AdChapter' columns by default.
I am attempting to write a simple sub I can have all _InitalizeLayout events call to auto-hide chapter columns but it appears the band.column.DataType is always Int32. I must be binding to my datasource in an odd way?
Also in all my shapes the Band.Key on child bands are basically the sum total of all prior bands names ... e.g. "tableMyFirstTableMySecondTableMyThirdTable"...
What happened to BaseTableName and BaseColumnName ??
It sounds like the two sets of data are similar enough that the grid is trying to re-use the same layout for both. Try setting the grid's DataSource to null in before setting it to the new data source.
I still have a greater problem... I can easily hide the IDs I don't want to show but now I have noticed that the child rows are empty in the grid. Using the above connection string I use the following connection string:
Provider=MSDataShape.1;Data Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDB;Data Source=PGM8\SQLExpress
I then use system.Data.DataSet then Systems.Windows.Forms.BindingSource then link the BindingSource to the Grid.
I use on the form four buttons that allow me to change to contents of the gris between the four loaded queries, examples are Donors, and Donors and their donations. Donors and their donations has a SHAPE but just Donors does not.
The grid form loads with Donors loaded as default. I can then click on Donors with Donations the first time and the child rows are fine. I then click on Donors then go back to Donors and their donations and now the Parent Donor rows are there but the Donations child rows are empty, no data. There are the same number of rows as I would expect but the data filling the rows is missing.
Any ideas?
Thanks for the help.
Hi Johauna,
The grid is going to display whatever columns the DataSource gives it. It won't automatically hide anything by default.
You can hide columns in the grid using the Hidden property on the column.