Autore Topic: Gridbox: colonna fantasma  (Letto 501 volte)

Offline andy60

  • Senatore Gambero
  • ******
  • Post: 1.256
    • Mostra profilo
    • https://www.linkedin.com/in/andbertini
Gridbox: colonna fantasma
« il: 16 Gennaio 2012, 23:21:30 »
In una tabella dove metto visibili in griglia solo due campi (gli altri sono inseriti in textbox con la proprietà 'enabledobjectlinked') mi compare una terza colonna non voluta, non riesco a toglierlaaaaaaa

 :hard: :hard: :hard: :hard: :hard:

questo è il codice, allego anche l'immagine della terza colonna non voluta...

 
Codice: [Seleziona]
   With GridBox4
    .Connection = $CCon
  End With
 
 With GridBox4.Columns[Col_d]
    .Hide = False
    .Type = Grid.Type.Field
    .Field = "cognome"
    .Text = "COGNOME"
    .Name = "cognome"
    .w = 150
    .ObjectLinked = Me.TextBox1
    .ObjectPropertyLinked = "Text"
    .Alignment = 1
  End With
 

 Inc Col_d
 With GridBox4.Columns[Col_d]
    .Hide = True
    .Type = Grid.Type.Field
    .Field = "id"
    .Name = "idcliente"
    .DataType = Grid.DataType.Serial
    .Text = "ID"
    .IsFieldKey = True
    .ObjectLinked = Me.TextBox8
    .ObjectPropertyLinked = "Text"
  End With 
   
  Inc Col_d
  With GridBox4.Columns[Col_d]
    .Hide = False
    .Type = Grid.Type.Field
    .Field = "nome"
    .Text = "NOME"
    .Name = "nome"
     .ObjectLinked = Me.TextBox2
    .ObjectPropertyLinked = "Text"
    .w = 150
    .Alignment = 1
  End With
 
  Inc Col_d
  With GridBox4.Columns[Col_d]
    .Hide = True
    .Type = Grid.Type.Field
    .Field = "telefono1"
    .Text = "TEL1"
    .Name = "tel1"
     .ObjectLinked = Me.TextBox3
    .ObjectPropertyLinked = "Text"
    .DefaultValue = "nd"
  End With
 
  Inc Col_d
  With GridBox4.Columns[Col_d]
    .Hide = True
    .Type = Grid.Type.Field
    .Field = "telefono2"
    .Text = "TEL2"
    .Name = "tel2"
     .ObjectLinked = Me.TextBox4
    .ObjectPropertyLinked = "Text"
    .DefaultValue = "nd"
  End With
 
  Inc Col_d
  With GridBox4.Columns[Col_d]
    .Hide = True
    .Type = Grid.Type.Field
    .Field = "telefono3"
    .Text = "TEL3"
    .Name = "tel3"
    .ObjectLinked = Me.TextBox5
    .ObjectPropertyLinked = "Text"
    .DefaultValue = "nd"
  End With
 
  Inc Col_d
  With GridBox4.Columns[Col_d]
    .Hide = True
    .Type = Grid.Type.Field
    .Field = "telefono4"
    .Text = "FAX"
    .Name = "tel4"
    .ObjectLinked = Me.TextBox6
    .ObjectPropertyLinked = "Text"
    .DefaultValue = "nd"

  End With
 
  Inc Col_d
  With GridBox4.Columns[Col_d]
    .Hide = True
    .Type = Grid.Type.Field
    .Field = "mobile"
    .Text = "CELL"
    .Name = "mob" ' Inc Col
    .ObjectLinked = Me.TextBox7
    .ObjectPropertyLinked = "Text"
    .DefaultValue = "nd"
    .Alignment = 1
  End With

 Inc Col_d
  With GridBox4.Columns[Col_d]
    .Hide = True
    .Type = Grid.Type.Field
    .DataType = Grid.DataType.Boolean   
    .DefaultValue = 0
    .Box.ValueCheck = -1
    .Box.ValueUncheck = 0
    .ObjectLinked = Me.CheckBox1
    .ObjectPropertyLinked = "Value"
    .Field = "effettivo"
    .Name = "effvo"
  End With

  Inc Col_d
  With GridBox4.Columns[Col_d]
    .Hide = True
    .Type = Grid.Type.Field
    .Field = "cartellina"
    .Text = "CART."
    .Name = "cart"
    .ObjectLinked = Me.TextBox9
    .ObjectPropertyLinked = "Text"
  End With 
 
  With GridBox4
    .Expand = True
    .Color.RowAlternating = Color.RGB(230, 230, 230)
    .AutoDataType = True
    .GridOnly = True
    .TableName = "tbrubrica"
    .LoadData(sqlcorrente2)
    .ColorRowAlternating = True
    .AutoNew = False
    .Grid = False
    .EnabledObjectLinked = True
  End With 
   
  Me.GridBox4.Header = Grid.Header.Horizontal

Offline andy60

  • Senatore Gambero
  • ******
  • Post: 1.256
    • Mostra profilo
    • https://www.linkedin.com/in/andbertini
[RISOLTO] Gridbox: colonna fantasma
« Risposta #1 il: 16 Gennaio 2012, 23:49:49 »
se l'ultima colonna è settata con hide=false e se prima di questa si inseriscono tutte le colonne con hide=true, la colonna fantasma viene azzerata