
GITTER
GRIDVIEW 

Ein Gitter kann eine Kopfzeile und eine Seitenspalte haben :

GridView.Both (gb.qt)
CONST Both AS Integer = 3  ---> Das Gitter hat eine Kopfzeile und eine Seitenspalte

Indicates that both horizontal and vertical headers must be displayed. 

----------------------------------------------------------------------------------------------------------

GridView.MoveTo (gb.qt)

SUB MoveTo ( Row AS Integer, Column AS Integer )
Sets the current cell. 

----------------------------------------------------------------------------------------------------------

  grdDatenAnzeige.Clear
  grdDatenAnzeige.Columns.Count = 8
  grdDatenAnzeige.Header = 1
  
  grdDatenAnzeige.Columns[0].Width = 130
  grdDatenAnzeige.Columns[0].Text = "Nachname"
  grdDatenAnzeige.Columns[1].Width = 120
  grdDatenAnzeige.Columns[1].Text = "Vorname"
  grdDatenAnzeige.Columns[2].Width = 90
  grdDatenAnzeige.Columns[2].Text = "GebDatum"
  
  PUBLIC SUB DBInhaltInGitterAusgeben()
  DIM aDatensatzArray AS NEW String[]
  DIM iZeile, iSpalte, iCount AS Integer

  iZeile = 0 
  FOR iCount = 0 TO aDatenbankArray.Max
      aDatensatzArray.Clear
      aDatensatzArray = Split(aDatenbankArray[iCount], "*")    
      grdDatenAnzeige.Rows.Count = iZeile + 1 ' Dynamische Verlängerung des Anzeigegitters (GridView)
    FOR iSpalte = 0 TO 7 ' Ausgabe der ersten 8 Felder (0..7) eines Datensatzes in einer GridView-Zeile
        grdDatenAnzeige[iZeile, iSpalte].Text = aDatensatzArray[iSpalte]
    NEXT
    INC iZeile
  NEXT 
END ' DBInhaltInGitterAusgeben() 

-----------------------------------------------------------------------------------------------------------

PUBLIC SUB Button1_Click() ' Zeilen und Spalten füllen
  DIM ligne AS Integer   ' Zeilen
  DIM colonne AS Integer ' Spalten
  
  gridview1.Rows.Count = 10
  gridview1.Columns.Count = 5
  
  FOR colonne = 0 TO 4
      FOR ligne = 0 TO 9
          gridview1[ligne, colonne].Text = "TEXT Z" & CInt(ligne + 1) & " S" & CInt(colonne + 1)
      NEXT
  NEXT

END

------------------------------------------------------------------------------------------------------------

PUBLIC SUB _new()
  GridView1.Columns.Count = 4
  GridView1.Rows.Count = 3
  GridView1.Columns.Width = 52
  GridView1.Rows[1].Height = 52
  GridView1[0,0].Text = "0,0"
  GridView1[0,0].Alignment = 4
  GridView1[1,1].Text = "1,1"
  GridView1[0,1].Text = "0,1"
  GridView1[1,0].Picture = Picture["x.png"]
END



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TABELLE
TABLEVIEW


    TableView1.Rows.Count = 4
    TableView1.Columns.Count = 5
    TableView1.Columns[0].Text = "Test"  ---> Physisch 1. Zeile ist Kopfzeile
    TableView1.Columns[0].Width = 120


---------------------------------------------------------


PRIVATE SUB FillGridWithData()
'put some test data
  
  DIM i AS Integer
  DIM Rows AS Integer = 20
  
  ME.gvTest.Columns.Count = 2
  ME.gvTest.Rows.Count = Rows 
  
  ME.gvTest.Columns[0].Title = "Key"
  ME.gvTest.Columns[1].Title = "List of Values"
  
  ME.gvTest.Columns[0].Width = 0 'please note I allways use first column in gridview to store the record key = WIRD NICHT ANGEZEIGT
  ME.gvTest.Columns[1].Width = ME.gvTest.Width
  
  FOR i = 1 TO Rows 
    ME.gvTest[i - 1, 0].Text = CString(i)
    ME.gvTest[i - 1, 1].Text = "This s the N# " & CString(i) & " Line"
  NEXT 
  
  'select first row
  ME.gvTest.Row = 0
  
END


------------------------------------------------------------------------------------------------------------


PRIVATE aro AS NEW Object[]
PUBLIC SUB _New()
  DIM ari AS Variant[]
  DIM i AS Integer
  DIM j AS Integer

  'es wird ein Array 10 X 10 erzeugt
  FOR i = 0 TO 9
    ari = NEW Variant[]
    ari.Resize(10)
    aro.Add(ari)
  NEXT

  'die Werte 1 bis 100 werden den Array-Elementen zugeordnet
  FOR i = 0 TO aro.Count - 1
    FOR j = 0 TO aro[i].Count - 1
      aro[i][j] = (i + 1) * (j + 1)
    NEXT
  NEXT

  TableView1.Rows.Count = 10
  TableView1.Columns.Count = 10
END

PUBLIC SUB TableView1_Data(Row AS Integer, Column AS Integer)
  TableView1.Data.Text = aro[Row][Column]
  IF aro[Row][Column] = 50 THEN TableView1.Data.BackColor = Color.Gray
END


-----------------------------------------------------------

Ausgabe aller Daten der Matrix:

PUBLIC SUB Button1_Click()
  DIM i, k AS Integer
  
  'txaWerteTabelle.Clear
  FOR i = 0 TO aMatrix.Max
      FOR k = 0 TO aDatensatz.Max
          PRINT aMatrix[i][k]
      NEXT ' k
  NEXT ' i
END

