AutoIncrement - DataGrid

G

Guest

I have a sql statement that uses the index server oledb provider to extract items from Index Server. The results are placed in a dataset and into a dataview. The dataview is binding to a datagrid and I am using template columns/items to output the data. I would like for the list of items being output to be sequentically numbered like a numbered list - is it possible to do this

I tried adding a column to the dataset and setting the autoincrement value to true and autoincrementseed = 1. When I try to bind the new column to the datagrid I get an error that the column doesn't exist

Dim dcRowIndex As New DataColumn("ID", GetType(Integer), "ID"

cmd.Fill(dsDataSet
dcRowIndex.AutoIncrement = Tru
dcRowIndex.AutoIncrementSeed =

'Add the columns to the DataTable's Columns collectio
dsDataSet.Tables(0).Columns.Add(dcRowIndex)
 
A

Alvin Bruney [MVP]

You have an error in your setup, please look at this page, it contains a
bind example.
http://tinyurl.com/ytvrg

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Mary said:
I have a sql statement that uses the index server oledb provider to
extract items from Index Server. The results are placed in a dataset and
into a dataview. The dataview is binding to a datagrid and I am using
template columns/items to output the data. I would like for the list of
items being output to be sequentically numbered like a numbered list - is it
possible to do this?
I tried adding a column to the dataset and setting the autoincrement value
to true and autoincrementseed = 1. When I try to bind the new column to the
datagrid I get an error that the column doesn't exist.
 
G

Guest

Just so I understand completely, with your examples my output will look like this:

(this is how I want it to look - the numbers are just numbers I don't need them to update the dataset - it will be read only)

1. Online Books from MyCompany
2. New Products from MyCompany


Instead of (this is how it currently looks)

Online Books from MyCompany
New Products from MyCompany
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top