Using version 16.2 of UltraWinGrid. We have several hidden columns in the grid. When we check out the form in Visual Studio 2015's C# and TFS, the hidden columns appear. This is becoming a big problem because many of our forms have numerous grids that have to be redone. Is this is a bug or is there a workaround?
Hi Mark,
I discussed this with the developer today and he said that there's no expected reason why the designer would wipe out all your code like that. In order to investigate this further, we will need a project file that reproduces the issue. Please send this to me and we will begin debugging.
If you do not wish to attach your files to the public forum, please let me know and I will open a private case for you.
It sounds like the designer encounters something unexpected while deserializing the columns, which is what's causing the column settings to get lost. My expectation is that you will need to rebuild these files in the designer.
I would like to discuss this with the developer of the grid to give you a more precise explanation of what's happening and why, as well as what you can do about it. The dev is out for the holiday, and I will ask him on Tuesday when we return from vacation.
Hi Mike,
Thanks for your reply.
The column values themselves were set by us. The designer files were initially converted automatically from VB6. While this might seem the cause of the problem, it doesn't happen with anything else out of dozens of controls. Only UltraGrid column settings. Everything else works perfectly. And the columns display as set when you first open the designer, so they're clearly being read from the designer file and working as intended. Just not written back if you do anything related to an UltraGrid. And it's intermittent - it happens sometimes and not others.
Another strange thing that happens with UltraGrids is that the columns are renamed every time. For example, ultradGridColumn32 will become ultraGridColumn45, with no input whatsoever. Never seen that in any other control. In makes me think there's something hokey/non deterministic with the backend algorithm for the columns and bands in databound UltraGrids.
Just a guess though. Thanks for your time on this - this is a major issue for us.
I do have one question that might help us find out why this is happening: How were those column settings created? If the designer.cs file was edited manually, Visual Studio might fail to persist those settings when reserializing. Visual Studio will normally regenerate the file in this way each time a change is made on the design surface.
If the changes were done manually instead of through the designer, this could cause the changes to be lost.
Thanks for your reply. So to explain what happens in more detail:
We open the Visual Studio designer for a form which contains a number of databound UltraGrids (bound to an Infragistics UltraDataSource via the designer) and other controls. Some of the columns in these UltraGrids have various settings such as "hidden". The designer.cs code looks like this before the changes:
// // SSDBGrid2 // this.SSDBGrid2.DataSource = this.SSDBGrid2DS; UltraGridColumn31.Header.VisiblePosition = 0; UltraGridColumn31.Hidden = true; UltraGridColumn31.Width = 123; UltraGridColumn30.Header.VisiblePosition = 1; UltraGridColumn30.Width = 72; UltraGridColumn29.Header.VisiblePosition = 2; UltraGridColumn29.Width = 64; UltraGridColumn28.Header.Caption = "Inv. Amt."; UltraGridColumn28.Header.VisiblePosition = 3; UltraGridColumn28.Width = 76; UltraGridColumn27.Header.VisiblePosition = 4; UltraGridColumn27.Width = 76; UltraGridColumn26.Header.VisiblePosition = 5; UltraGridColumn26.Width = 76; UltraGridColumn25.Header.VisiblePosition = 6; UltraGridColumn25.Hidden = true; UltraGridColumn25.Width = 123; UltraGridColumn24.Header.VisiblePosition = 7; UltraGridColumn24.Hidden = true; UltraGridColumn24.Width = 123; ultraGridBand6.Columns.AddRange(new object[] { UltraGridColumn31, UltraGridColumn30, UltraGridColumn29, UltraGridColumn28, UltraGridColumn27, UltraGridColumn26, UltraGridColumn25, UltraGridColumn24}); this.SSDBGrid2.DisplayLayout.BandsSerializer.Add(ultraGridBand6); this.SSDBGrid2.DisplayLayout.BorderStyle = Infragistics.Win.UIElementBorderStyle.None;
Upon changing anything on the designer, for example moving some buttons around, the designer files gets rewritten and various items in the designer.cs file moved around. After this happen, the designer code looks like this:
// // SSDBGrid2 // this.SSDBGrid2.ActiveRowIndex = 0; this.SSDBGrid2.DataSource = this.SSDBGrid2DS; this.SSDBGrid2.DisplayLayout.BorderStyle = Infragistics.Win.UIElementBorderStyle.None;
As you can see, all of the column information has been lost. The columns still display of course, because they're in the datasource, but every customization made to the columns of the UltraGrid seems to be gone.
I hope that helps you track it down. If you have any idea what might be going, that would be helpful, we have over 150 forms with hundreds of UltraGrids on them, so hand editing here isn't a viable solution.
If you don't know what could be happening, we'll try our best to get you a sample, but it might be difficult.