cancel
Showing results for 
Search instead for 
Did you mean: 

Grid numbers

0 Kudos

Hi,

does any1 know how to get row numbers on a grid?

Setting the "RowsHeader" just gives an error...

Thx in advance.

/Peter Halden

Accepted Solutions (1)

Accepted Solutions (1)

RamBilasYadav
Participant
0 Kudos

Hi Peter,

If u have bound the grid to a table then u could bind the column to the field which has the line number. This will automatically display the line numbers.

Regards,

Ram.

RamBilasYadav
Participant
0 Kudos

Hi,

Alternately if you want to add the line numbers dynamically something like the below code can be used.

oMatrix.AddRow()

oMatrix.columns.Item("1").Cells.Item(i).Specific.value = i

This is a working code which I use in my transaction.

Hope it helps.

Regards,

Rara.

0 Kudos

I think you are using matrixes - i am talking about grids which can only have a DataTable as a datasource...

/Peter

Former Member
0 Kudos

As the grid with an underliing datatable will show you all columns you fetch, you can try to populate the first column of the datatable with row numbers.

To do so you only have to create a SQL query/Stored Procedure which returns the count of the actual row. One approach can be a selfjoin like this little example:

SELECT count(*) LineNumber,

a.LastName

FROM OHEM a join

OHEM b

on a.LastName >= b.LastName

group by a.LastName

order by a.LastName

Answers (1)

Answers (1)

Former Member
0 Kudos

I have seen this question asked before and there is no answer, so I suspect that there is currently no way to do this. I too would like to be able to set the text in the row headers of a grid, but cannot find a way to do so. If anyone knows how this can be done, or when it will be supported, please help us both!