Hi there,
since years and several versions of the NetAdvantage library my colleagues and I are experiencing a strange behavior which all of us costs a lot of time in total so that's the reason why I'm posting it now.
We have a lot of business classes that are responsible to exchange data with the database server. We are using the MS BindingSource to fill up the WinGrid with our business object's data which works great. Our problem is that WinGrid sometimes temporary looses the 'connection' to the data schema of the business object and when this is estrablished again all column arrangements including groups are lost. This is extremely annoying and time consuming because every time you've to start from scratch by setting it up newly in Visual Studio Designer. I've now written a class that handles that programmatically during FormLoad to overcome that.
For a long time I didn't know where this problem comes from but now I think I've at least a little glue. If I've opened a form containing a WinGrid in Visual Studio Designer, debug the application from Visual Studio with having the form still visible in Designer (the Visual Studio Tab with that form is selected), close the application then all columns in WinGrid disappear in Designer. If I start to design the WinGrid there is no Data Schema established thus I cannot do anything in the column arrangement overview. If I close the WinGrid Designer the Data Schema is established afterwards. When I'm lucky the column arrangements are still there but sometimes they are lost.
When I close the form in Designer after ending debugging the application and the re-open it again this works also fine. It seems that there is a problem when the form is open in the Designer when the debugging session is started and then ended. I’ve set NewBandLoadStyle and NewColumnStyle properties of WinGrid DisplayLayout to Hide but that didn’t change anything.
As I said at the beginning we do have this problem with all NetAdvantage libraries starting from 2007.3, with Visual Studio 2008 and 2010 running on Windows XP Professional 32bit and Windows 7 Professional 64bit.
I wonder, that no other people do have similar problems?
Regards, Wolfgang
Hello Wolfgang,
Thanks for provided information. If I understand well, you are using version 2007.3, if so my suggestion is to upgrade your current version to latest available version 2012. vol. 1, because between these 5 years (version 2007 - 2012) we improve our controls and also we fix few issues with the UltraGrid`s designer.
Please let me know if you have any questions
Regards
Hi Georgi,
thanks for your reply. We are keeping the Infragistics libraries up to date, at the moment we are using 2011 Vol. 2 and what I wanted to mention with my posting is that we are experiencing that problem since we started our project with 2007.3 :-) We will update to 2012 Vol. 1 within the next week and I've ask our IT responsible to get us the keys for that version.
Hello Georgi,
thanks for your effort.
I've created a complete new test project built up similar as our real application using 12.1 but there it works like a charm. Fortunately I had another playground project which shows the faulty behavior even after upgrading from 11.2 to 12.1. I've tried to investigate what could be the difference between the two implementations but I think I'll leave that to you Infragistics experts :-) I've reduced that project to the minimum needed functionality but there are some controls on the form which are of no use but they should not influence the rest. The problem here is as soon as I start a debug session of the project out of Visual Studio, having the Form still opened in the designer I see the form changing it's layout to show only the group as depicted in picture below:
The application itself shows the persons in the UltraGrid correctly:
If I now close my application the Form in the VS Designer still shows the same layout as depicted in above picture. If I click on 'Start!' to design the UltraGrid it shows like having no data schema associated. Sometimes it recovers from that state if I click on Cancel button again but sometimes not.
I've zipped that mini project and hopefully you can reproduce the problem with that. I'm running VS 2010 Professional on Windows 7 Enterprise 64 bit with 8GB RAM but my experience is that it is not depending on that since I had it already with VS 2008 on Windows XP 32 bit.
Thanks for attached sample. I was able to see your issue. Please give me a time for research. I`ll inform you when I have results.
Thanks again and Regards
Georgi
cool, that you are able to see my issue now. Take your time to investigate in it and hopefully their will be a solution for that. I'm just wondering why not more customers do have the problem?
Thanks and kind regards, Wolfgang
I research your issue using your sample and reseaons for this behavior is cause from the BindingSource. The grid designer lists all the bands and columns, if BindingSource provide this information. Sometime you see that the grid at design-time, doesn`t have any rows. It is because your BindingSource is null and grid designer unable to determine the data structure / layout.
Please take a look at the attached video file, where I reproduce your issue and than I provide one possible approach to solve it. Let me know if you have any questions.
I have tried the solution represented in the video and it does not work. Even with the manual datasource assignment it still loses the format.
I am reverting back to 10.3.
Keep this ticket open.
This is a serious problem.
Hello Wolfgang
qbupoew said:I see is that it contains the library version of the grid which makes perfect sense but will it work if I save the Display Layout with a certain version to a file to open it with any future version of the library i.e. is this backward compatible?
Yes, you could save your layout for exmaple with version 10.3 and then you will be able to load the same layout in version 12.1.
Please do not hesitate to write us if you have any questions.
thanks for the hint for saving and loading the display layout of the grid, didn't know that so I tried to write it to a file which worked fine. I looked into the file to see which format it is, it looks rather binary but what I see is that it contains the library version of the grid which makes perfect sense but will it work if I save the Display Layout with a certain version to a file to open it with any future version of the library i.e. is this backward compatible?
Anyhow, the solution with the separate class dealing with the column definitions has proven itself to be the best for us. If offers also a function to create the necessary code out of an existing grid which is more or less the same as saving the display layout to file.
I assume, that there are other users outside struggling more with that problem so maybe they have good sample code to show?
Maybe one possible approach could be if you are using Save and Load methods of the UltraGrid`s layout. For example:
ultraGrid1.DisplayLayout.Save()
ultraGrid1.DisplayLayout.Load()
Please let me know if you have any further questions or if you have another sample with your issue. I`ll be glad to take a look.
after having a long weekend I realized some progress on that issue. Unfortunately the behavior of that problem is varying little bit so in that small example you've been investigating it's the most obvious case because here it happens every time when running the application. I have UserControls which work for weeks and suddenly they loose their entire layout and I had to re-arrange the columns hide the ones that should not be shown etc. which is very time consuming. After I did this several times I've written an own class that manages the layout of the grid after everything is set-up by calling a function in that class from the Load-event. In the meantime I'm using this class for most of my UltraGrids. I've one dialog that once in a day shows the behavior which does not use my managing class.
I think, that the problem is how objects are created in the InitializeComponent function so that maybe the Grid gets initialized before the binding source is fully initialized?
Have you been able to resolve your issue ? If you still have any concerns or questions I will be glad to help. If you need any additional assistance don’t hesitate to ask.