Hello,
In my grid designer I am trying to do the same as if our programmers were to click on "Manually Define Schema", followed by "Reset Schema" and then chose the option "If you WILL be supplying a DataSource at runtime...".
At first it seems to work as the columns are gone. But when I re-open the form, they will be back. So, I must be missing something that commits the change at design time.
Does anybody know what needs to take place to clear the schema?
Thanks,
Trausti
Hello ,
After you rest schema (“Edit Schema” designer dialog, press “Reset Schema” button, press “OK” button), choose “If you WILL be supplying a DataSource at runtime… ” from “Save Schema” designer dialog and press “OK”. Then on the “UltraWinGrid Designer” dialog press “Apply” or “Ok” button in order to apply the changes.
Please let me know if you have any further questions.
Thanks for the reply Hristo. This is not quite what I am looking for. What you described is what I want to do in code. I have a custom grid that inherits from the UltraGrid and there is a custom designer for this grid that inherits from the UltraGridDesigner. In the designer I have implemented a command (action) which when clicked on, should execute the code required to accomplish what you described in your reply.
The code I have there now is resetting as expected, but it appears not to be serialized as the columns are back when the form is opened again in Visual Studio. I am guessing the way I am working with the grid at design time, is not the correct way.
Here is what I am doing right now:
grd = CType(Me.Control, Controls.PCGrid)grd.DisplayLayout.Bands(0).ResetColumns()grd.DisplayLayout.ResetBands()grd.DataBindings.Clear()grd.DataSource = Nothinggrd.SetDataBinding(Nothing, "")
As you can see, I am just trying any and all methods that clear the layout :)
I am going to look at Infragistics source code to try to understand what takes place on Reset Schema, but if somebody has done this already and could post some code snippets, then that would be great!
I did not really figure this one out, but by changing how the columns were created at design time I ended up not requiring the reset. I am now creating UltraDataSource and binding to it. End result is what I was after in first place.
Hello,
As far as I understand your end results is what you are looking for. Please let me know if you need my further assistance on this.
Thank you for using Infragistics Components.