I have quite a large application and when new columns are added to the tables in the database, and consequently to the LinqToSql entities, they automatically just appear in my carefully laid out WinGrids and Combo's throughout the application.
Sorting this out is an unnecessary distraction from the task in hand and I was hoping that there is a way of locking down the WinGrid layout or setting it to an opt in for columns, so instead of visible they are hidden by default.
Excellent that works!
Here is how I implemented it;
Imports Infragistics.Win.UltraWinGrid
Public Class ipUltraWinGrid Inherits Infragistics.Win.UltraWinGrid.UltraGrid
Protected Overrides Sub OnCreateControl() Me.DisplayLayout.NewColumnLoadStyle = NewColumnLoadStyle.Hide
MyBase.OnCreateControl() End Sub
End Class
Many Thanks
Hi Lary,
May be other possible suggestion is to save and load your layouts. The new columns will missing in your saved layout. You can also save / load the layout in / from external files. For example look the code below:
ultraGrid1.DisplayLayout.SaveAsXml("Your layout file");ultraGrid1.DisplayLayout.LoadFromXml("Your layout file");
Hi Larry,
I think this is what you're looking for:
this.ultraGrid1.DisplayLayout.NewColumnLoadStyle = NewColumnLoadStyle.Hide;
There's also a similar property for bands:
this.ultraGrid1.DisplayLayout.NewBandLoadStyle = NewBandLoadStyle.Hide;