How to insert value into template column at runtime?

coranyge

New member
Joined
May 28, 2006
Messages
3
Programming Experience
Beginner
Hi how can I insert value into a template column at runtime?

I have this datagrid which contains multiple record and I want a template column to be filled with values corresponding to its row number at runtime

example.

Dim i as integer
Dim noOfRecords = CountNumberOfRecords()
For i = 0 to noOfRecords Then
Row 0 then SerialNo.Row0.Value = 0
Row 1 then SerialNo.Row1.Value = 1
Next

where SerialNo is the column name of the template

it looks something like this which the primarykey is my serialNo which does not link to the database, just showing the row number of the item
http://www.daveandal.net/articles/databinding-syntax/basic-binding.aspx
 
Last edited:
Try a correlated sub query. Syntax is like this...

SELECT (SELECT COUNT(*) FROM row_num_id B WHERE B.col1 <= A.col1 AND B.col2 <= A.col2 AND B.col3 <= A.col3) AS ROWNUMBER,
col1,
col2,
col3,
creation_date
FROM row_num_id A
 
Back
Top