| Visual Basic (Declaration) | |
|---|---|
Public Property NewBandLoadStyle As NewBandLoadStyle | |
| C# | |
|---|---|
public NewBandLoadStyle NewBandLoadStyle {get; set;} | |
The following code sets the NewColumnLoadStyle and NewBandLoadStyle properties to Hide and provides an explanation on how they works. Note that you must set DataSource after setting these properties.
| Visual Basic | Copy Code |
|---|---|
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub FrmFilterRow_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load ' NewColumnLoadStyle and NewBandLoadStyle let you hide any new columns in the ' datasource that does not exist in the current layout. For example at design ' time if you added A and B columns and in the data source there are A, B and ' C columns then setting the NewColumnLoadStyle to Hide will cause the C to ' be hidden because it does not exist in the current layout. Only A and B ' exist in the current layout. NewBandLoadStyle works in a similar manner ' however with the bands. Note that you must set these properties before ' setting the DataSource. Me.UltraGrid1.DisplayLayout.NewColumnLoadStyle = NewColumnLoadStyle.Hide Me.UltraGrid1.DisplayLayout.NewBandLoadStyle = NewBandLoadStyle.Hide Me.UltraGrid1.DataSource = DataSet1 End Sub | |
| C# | Copy Code |
|---|---|
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void frmFilterRow_Load(object sender, System.EventArgs e) { // NewColumnLoadStyle and NewBandLoadStyle let you hide any new columns in the // datasource that does not exist in the current layout. For example at design // time if you added A and B columns and in the data source there are A, B and // C columns then setting the NewColumnLoadStyle to Hide will cause the C to // be hidden because it does not exist in the current layout. Only A and B // exist in the current layout. NewBandLoadStyle works in a similar manner // however with the bands. Note that you must set these properties before // setting the DataSource. this.UltraGrid1.DisplayLayout.NewColumnLoadStyle = NewColumnLoadStyle.Hide; this.UltraGrid1.DisplayLayout.NewBandLoadStyle = NewBandLoadStyle.Hide; this.UltraGrid1.DataSource = dataSet1; } | |
NewBandLoadStyle property can be used specify how new columns are loaded when a data source is bound. If set to Hide any new columns and bands contained in the data source are hidden. With this feature you can define columns at design time and set a datasource at runtime that has more columns and bands and have them automatically hidden.