Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
WinGrid - Changing Band(0) Affects Band(1) - Help
posted

When changing a checkbox column on band(1) "ISREQUIRED" to be left aligned it makes a completely different (key = "CLOSE") column in band(0) also left-aligned. Can't seperate the two ... ALSO changing the autofitstyle on one band changes it on the other (last one that gets set wins)... the column sizing is set to "free" I am specifying the band to change.  There is nothing setup via the wizard ... I am banding a dataset with two related tables and setting all properties and unbound columns programatically, either in the form_load event or the grid_initializeLayout event.  [code below]  PLEASE HELP ... driving me crazy :) 

<Called from Form_Load>

 
    Private Sub LoadGrid()

        Dim DS As Data.DataSet

        DS = dbAssist.MultiSelect("usp_list_grid_jobruns")

        Dim data_relation As New  _
             DataRelation("MyRelation", DS.Tables(0).Columns("ID_Job"), DS.Tables(1).Columns("ID_Job"))

        DS.Relations.Add(data_relation)

        JobRunGrid.DisplayLayout.ViewStyle = Infragistics.Win.UltraWinGrid.ViewStyle.MultiBand

        JobRunGrid.DataSource = DS

        JobRunGrid.DisplayLayout.Bands(1).CardView = True

        ' Add Fonts and Font Sizes
        JobRunGrid.DisplayLayout.Appearance.FontData.SizeInPoints = 10
        JobRunGrid.DisplayLayout.Appearance.FontData.Name = "Segoe UI"

        JobRunGrid.DisplayLayout.Bands(0).Header.Appearance.FontData.SizeInPoints = 10
        JobRunGrid.DisplayLayout.Bands(0).Header.Appearance.FontData.Name = "Segoe UI"


        ' Add Unbound Columns
        JobRunGrid.DisplayLayout.Bands(0).Columns.Add("Close")
        JobRunGrid.DisplayLayout.Bands(0).Columns("Close").DataType = GetType(Boolean)
        JobRunGrid.DisplayLayout.Bands(0).Columns("Close").CellClickAction =   Infragistics.Win.UltraWinGrid.CellClickAction.Edit

        JobRunGrid.DisplayLayout.Bands(0).Columns.Add("Timed")
        JobRunGrid.DisplayLayout.Bands(0).Columns("Timed").DataType = GetType(String)

        ' Hide Certain Columns
        JobRunGrid.DisplayLayout.Bands(0).Columns("JobRunID").Hidden = True
        JobRunGrid.DisplayLayout.Bands(0).Columns("ID_Job").Hidden = True
        JobRunGrid.DisplayLayout.Bands(0).Columns("DisplayOnHold").Hidden = True
        JobRunGrid.DisplayLayout.Bands(0).Columns("LateWarningDelay").Hidden = True
        JobRunGrid.DisplayLayout.Bands(0).Columns("DateCreated").Hidden = True
        JobRunGrid.DisplayLayout.Bands(0).Columns("Schedule").Hidden = True

        ' Set Header Captions (Names)
        JobRunGrid.DisplayLayout.Bands(0).Columns("CustomerName").Header.Caption = "Customer"
        JobRunGrid.DisplayLayout.Bands(0).Columns("JobName").Header.Caption = "Job Name"
        JobRunGrid.DisplayLayout.Bands(0).Columns("ServerType").Header.Caption = "Type"

        ' Set Column Widths
        JobRunGrid.DisplayLayout.Bands(0).Columns("CustomerName").Width = 350
        JobRunGrid.DisplayLayout.Bands(0).Columns("JobName").Width = 350
        JobRunGrid.DisplayLayout.Bands(0).Columns("ServerType").Width = 90
        JobRunGrid.DisplayLayout.Bands(0).Columns("Status").Width = 90
        JobRunGrid.DisplayLayout.Bands(0).Columns("Timed").Width = 120


        ' Set Column Order
        JobRunGrid.DisplayLayout.Bands(0).Columns("CustomerName").Header.VisiblePosition = 1
        JobRunGrid.DisplayLayout.Bands(0).Columns("JobName").Header.VisiblePosition = 2
        JobRunGrid.DisplayLayout.Bands(0).Columns("Timed").Header.VisiblePosition = 3
        JobRunGrid.DisplayLayout.Bands(0).Columns("Status").Header.VisiblePosition = 4
        JobRunGrid.DisplayLayout.Bands(0).Columns("Close").Header.VisiblePosition = 5


        JobRunGrid.DisplayLayout.Bands(1).CardSettings.AutoFit = False
        JobRunGrid.DisplayLayout.Bands(1).CardSettings.ShowCaption = False
        JobRunGrid.DisplayLayout.Bands(1).CardSettings.Width = 375

 
    End Sub

 <Grid InitializeLayout>

        e.Layout.Bands(1).Override.HeaderAppearance.BackGradientStyle = Infragistics.Win.GradientStyle.GlassBottom37Bright
        e.Layout.Bands(1).Override.HeaderAppearance.BackColor = Color.BurlyWood
        e.Layout.Bands(1).Override.HeaderAppearance.BackColor2 = Color.Sienna
        e.Layout.Bands(1).Override.CellAppearance.BackColor = Color.BurlyWood

        e.Layout.Bands(0).Override.CellAppearance.BackColor = Color.LightCyan
        e.Layout.Bands(0).Override.HeaderAppearance.BackGradientStyle = Infragistics.Win.GradientStyle.GlassBottom20Bright
        e.Layout.Bands(0).Override.HeaderAppearance.BackColor = Color.WhiteSmoke
        e.Layout.Bands(0).Override.HeaderAppearance.BackColor2 = Color.SeaGreen

        e.Layout.Bands(0).Override.HeaderAppearance.TextHAlign = Infragistics.Win.HAlign.Center
        e.Layout.Bands(1).Override.HeaderAppearance.TextHAlign = Infragistics.Win.HAlign.Center

        e.Layout.Bands(0).Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect
        e.Layout.Bands(1).Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect


        e.Layout.Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Free
       
e.Layout.Bands(0).Layout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ExtendLastColumn
e.Layout.Bands(1).Layout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.None

[both bands end up with autofit set to "None", if I reverse it then BOTH bands end up with "ExtendLastColumn"]

Parents Reply Children