Get data from a column (not the head) of the control WebTable

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Get data from a column (not the head) of the control WebTable

מיוסט שרו��
First of all sorry for my english


I put on the Form the WebTable1

To set the top of the table as follows:

Dim i As Integer
 
  WebTable1.Columns.Count = 2
  For I = 0 To WebTable1.Columns.Count - 1
    WebTable1.Columns [I] .Text = Chr $ (65 + I)
  Prev

So far there are two columns of the table head of the first column I Text of "A1" and
the second "A2"

To add rows to the table as follows:

  WebTable1.Count = 2

And the event "Data" of WebTable1 that:

Public Sub WebTable1_Data (Row As Integer, Column As Integer, Data As WebTableData)

  Data.Text = "This is the" & CStr (Row) & ":" & CStr (Column) & "cell"
  WebTable1.Rows [1] = 1
End

If I want to know the value of the second column in the title table I do this:

Print WebTable1.Columns [1] .Text

My question is how I can get the value of each column which is the second or third line,
etc.


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get data from a column (not the head) of the control WebTable

Benoît Minisini
Le 12/01/2017 à 10:07, מיוסט שרון a écrit :

> First of all sorry for my english
>
>
> I put on the Form the WebTable1
>
> To set the top of the table as follows:
>
> Dim i As Integer
>
>   WebTable1.Columns.Count = 2
>   For I = 0 To WebTable1.Columns.Count - 1
>     WebTable1.Columns [I] .Text = Chr $ (65 + I)
>   Prev
>
> So far there are two columns of the table head of the first column I Text of "A1" and
> the second "A2"
>
> To add rows to the table as follows:
>
>   WebTable1.Count = 2
>
> And the event "Data" of WebTable1 that:
>
> Public Sub WebTable1_Data (Row As Integer, Column As Integer, Data As WebTableData)
>
>   Data.Text = "This is the" & CStr (Row) & ":" & CStr (Column) & "cell"
>   WebTable1.Rows [1] = 1

---> What is that supposed to mean?

> End
>
> If I want to know the value of the second column in the title table I do this:
>
> Print WebTable1.Columns [1] .Text
>
> My question is how I can get the value of each column which is the second or third line,
> etc.
>

I don't understand your question. I just can tell you that WebTable does
not store the content of the table. It is up to your code to do that.
WebTable just asks you for the data through its "Data" event.

Regards,

--
Benoît Minisini

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get data from a column (not the head) of the control WebTable

מיוסט שרו��
In reply to this post by מיוסט שרו��
This line:

WebTable1.Rows [1] = 1

I have written accidentally



I know,
To insert a data table
By event "Data"

But my question
When the table has 3 rows and each row has two columns

I want to get to the "Text" there is a row 3 column 2

I do not see such a possibility

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get data from a column (not the head) of the control WebTable

Casper
Hi,

On 12/01/2017, מיוסט שרון <[hidden email]> wrote:

> But my question
> When the table has 3 rows and each row has two columns
>
> I want to get to the "Text" there is a row 3 column 2
>
> I do not see such a possibility

I struggled with something similar recently.  I think I know what you
mean and if I'm right you may have to adapt this code to fit your
needs.  This might, or might not, be what you are looking for.

Dim iMaxRows As Integer

  iMaxRows = ColumnView1.Count

  ' populate variables from columnview
  ColumnView1.MoveFirst
  For iCount = 0 To iMaxRows - 1
    myVarA = ColumnView1.Item[1]
    myVarB = ColumnView1.Item[2]
    ' do whatever else
  next

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get data from a column (not the head) of the control WebTable

Fabien Bodard-4
There is a major difference between columnview and webtable one store
data's the other not

So to get the data of the line 3

Myarray[webtable.row]
Le 13 janv. 2017 11:59, "Casper" <[hidden email]> a écrit :

> Hi,
>
> On 12/01/2017, מיוסט שרון <[hidden email]> wrote:
>
> > But my question
> > When the table has 3 rows and each row has two columns
> >
> > I want to get to the "Text" there is a row 3 column 2
> >
> > I do not see such a possibility
>
> I struggled with something similar recently.  I think I know what you
> mean and if I'm right you may have to adapt this code to fit your
> needs.  This might, or might not, be what you are looking for.
>
> Dim iMaxRows As Integer
>
>   iMaxRows = ColumnView1.Count
>
>   ' populate variables from columnview
>   ColumnView1.MoveFirst
>   For iCount = 0 To iMaxRows - 1
>     myVarA = ColumnView1.Item[1]
>     myVarB = ColumnView1.Item[2]
>     ' do whatever else
>   next
>
> ------------------------------------------------------------
> ------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...