WebTable

Post

Posted
Rating:
#1 (In Topic #875)
Banned
 Does anyone know how to fill a WebTable ?

Seems odd there's AddColumn and other column stuff yet no Row stuff at all ?

Any examples / advice welcome

Cheers
Bruce
Online now: No Back to the top

Post

Posted
Rating:
#2
Banned
It's okay i have the answer now…

It's all in the WebTable_Data() event
The Data event triggers for each cell in the table on refresh.

You add Rows by simply setting the .Count property
then handle everything in the Data event…

Something like this….

Code (gambas)

  1.  
  2. Public sFiles As String[]
  3.  
  4.   Public Sub WebForm1_Open()
  5.  
  6.   WebTable1.Columns.Count = 2
  7.   WebTable1.Columns[0].Text = "Type"
  8.   WebTable1.Columns[1].Text = "Name"
  9.  
  10.   sFiles = Dir("/readable_dir")
  11.  
  12.   WebTable1.Count = sFiles.Count
  13.  
  14.  
  15. Public Sub WebTable1_Data(Row as Integer, Column As Integer, Data As WebTableData)
  16.  
  17.   Select Column
  18.     Case 0
  19.       Data.Text = if(IsDir("/readable_dir" &/ sFiles[Row]), "Dir", "File")
  20.     Case 1
  21.       Data.Text = sFiles[Row]
  22.     End Select
  23.  
  24.  
Online now: No Back to the top
1 guest and 0 members have just viewed this.