I am really exasperated about this. I have a windows forms project in which I am using UltraGrid to present and manage information. I spend a lot of time manually creating column definitions and dragging things around to get multi line layouts the way we need them.
It all works ok, until sometime for some reason I have not been able to determine, I re-open the form that has been saved in TFS, and the columns and layouts are gone. I can find them in previous versions in TFS, but the way the UltraGrid Designer creates the definitions in the form.designer.cs file is such that there is no way to bring the layouts and columns back except to manually re-create them.
Is there a way I can store these columns and layouts to a file so that when they disappear, I can just read them back from a file?
Help
Jim Frisby
Hello Jim,
You could use the 'Save()' or 'SaveAsXml()' methods on the grid's layout, like this:
ultraGrid1.DisplayLayout.Save("filename");
Please feel free to let me know if I misunderstood you or if you have any other questions.
The problem I am having is that the design time definition of the entire column and layout for the grid gets lost from the <formname>.designer.cs file. If I use "Save" at runtime, how would I get the definition back into the design files? Is that even possible?
Does "SAVE" have a complementry method "LOAD" ? If so, does it create the columns as well as the arrangement? Would I have to use one of the grids events to load them before the grid gets populated with data?
Please archive it(as zip if possible) and attach it to your next post. When writing it, please go to 'Options' tab above and click on the 'Add/Update' button, browse for your file.
Here is the layout file, along with the form from which it was created. The test was done with the grid on the "consequences" tab, named "ugLocations".
Hello,
Using this file I was not able to get any columns. I know that there was such an issue but it has already been fixed. So this must be another issue. I need to have a sample which reproduces this every time so I could ask our enginnering staff about this behavior. I might need your datasource as well, I really do not know how exactly to reproduce this.
Thanks for your continuing attention to this problem. I have created a stand-alone solution in VS 2010 which demonstrates the problem (see zip file). In this instance, Form1 contains the defined grid. I produced this grid layout by copy/paste from my actual project. Form2 contains the result when I use the wizard to export the grid from form1 and import it to form 2. In the zip file I have also included the intermediate .lyt file used in this instance.
You should be able to open the solution, create a new form and try importing the .lyt file into a grid, and also use the wizard on form1 to export the grid layout and try importing that resulting .lyt file.
Jim
Thanks for attached sample. I was able to reproduce your issue, but the mentioned behavior is expected for your scebario, because when you load your layout in the new grid, you should have the same bands and columns keys like in your original grid. The layout looking for these keys and apply the layout settings only for these bands and columns.
I made small video file to represent this behavior. Please take a look at the attached video and my comments below:
1. At the beggining I create a new layout for my gird in Form 1. You will see that I create 7 columns and each column has a key: "Column 0", "Column 1", "Column 2" ..... up to "Column 7". Using the Layout wizard I save this layout at my machine.
2. In the second step I try to load this layout into my second grid in Form 2. Please note, at that moment I didn`t create any columns in the grid, so I have not coincidence between column`s keys in grid 2 with the keys that I save inthe layout. That`s why, when I load the layout you are not able to see the columns.
3. In the third step, I will create only 4 columns into my second grid (the grid in the Form 2) and these 4 columns will have matching keys with the keys from layout file. By this way, when I load the layout, I will apply our layout only for these 4 columns. If you decide to add all columns using the matching keys , you could re-load again your layout, by this way we will have similar layout in both grid.
So if you decide to export the layout from one grid and import this layout into another grid, please note the both grids should have bands and columns with matching keys.
Please lt me know if you have any questions.
Regards
FlyingJ said:I was able to combine the .rar files and view the video with 7zip.
Please download all parts from the video file in one folder and then try to Extract the content using RAR. I splite the video file, because it is too big to upload it.
If you have any problems, please write me, I`ll try to find another solution.
Hello FlyingJ,
As far as I know it is not possible to extract the these columns from your grid and import it into another grid, but maybe one possible solution could be if you are using UltraDataSource to create your columns with appropriate column`s key and then you could use this UltraDataSource (this datasource will be empty, without data) for all your grids.
Let me know if you have any questions.
I was able to combine the .rar files and view the video with 7zip.
I am trying to open the .rar files with 7Zip, it says the .avi files included are "broken". What tool do you recommend for extracting these videos?
Thanks for your reply. I am using only unbound columns in this example. I was under the impression that the wizard was able to save and import both the unbound columns and the layout. Is there a way to save unbound columns in from one grid and then import them into another grid?