I have an UltraWinGrid where I have set the DataSource to a DataSet that contains 2 tables with a relation set between the two tables on a column named "CodeNumber" as the Parent Column and "ChildColumnNumber" as the Child column. My grid displays as I would expect, but I would like the column "CodeNumber" in Band(0) to be displayed. I have a line of code inplace to do this but if I set a break point in the line and inspect the value of Hidden before and after I set it to False it does NOT change.
Is there some way to "override" this behavior?
I'm using the latest versoin of NetAdvantage and VB.Net 2013.
Thanks,
Jamie Irwin
Hello Jamie,
I am glad you have managed to resolve your issue.
Please do not hesitate to contact me if you have any additional questions.
Thank you for using Infragistics components.
Atanas,
I believe that I have figured out what my problem was. When I called the .Relation.Add() function on my DataSet, I supplied the first parameter as the name of the Relation, and the value I supplied was the same as the name of the Column that was being hidden. I simply change the value of the first parameter and now my column displays.
As far as I'm concerned this issue is resolved.
Thanks for the help,
Thanks Atanas,
I've been working for the past hour or so to try to make your sample code reproduce my problem and as yet have not been able to reproduce my problem.
One main difference is that I am loading my DataSet from a MS SQL stored procedure and I am loading the Parent table first then the Child table, but I modified your GetSampleData function to switch the tables and your sample still works.
I had also set the .DislpayLayout.CaptionVisible = False, so I did that on your grid from the properties page while in the Design View of the form, so that made our Grids look more similar. Also in GetSampleData you were using a string value as the filed to relate the tables on so I switched it to the OwerID Integer column but still your sample works.
I had also been setting several other properties from code and set those same properties in you sample, but your sample still worked, I list those properties here for reference:
With Frm.ugDetailCodeOrMinMax
.DataSource = moDetailCodeDS.Copy
.UpdateMode = UpdateMode.OnUpdate
.DisplayLayout.ViewStyle = ViewStyle.MultiBand
.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns
.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnDisplay
.DisplayLayout.Override.ColumnAutoSizeMode = ColumnAutoSizeMode.AllRowsInBand
.DisplayLayout.Override.AutoResizeColumnWidthOptions = AutoResizeColumnWidthOptions.All
.DisplayLayout.Override.GroupByColumnsHidden = Infragistics.Win.DefaultableBoolean.False
.
End With
As you can see above I also tried setting GroupByColumnsHidden but it had no affect on my code.
So my guess is that it either has something to do with the fact that my DataSet is loaded from an MS SQL stored procedure or there is some other setting that is different. I will continue to look for differences. Would it be possible for you to do a sample where your DataSet is loaded from a couple of database tables or some other data source?
Thanks Again,
I have tried to reproduce your issue and everything seems to work fine for me. When I set a relation between two tables both the parent column and the child one are visible when I run the program. So, I assume that the issue you’ve got occurs due to grouping by the column ‘CodeNumber’. If you group by some column it would no longer be visible in the band. In order to make it visible you could set the GroupByColumnHidden property to false.
I have implemented this suggestion in a simple sample and you could run and evaluate it. Please see attached zip.
However, if that’s not the case could you please modify my sample in order to reproduce the issue you’ve got, so I’ll be able to investigate this on my own?
I am waiting for your feedback.