|
-
Nov 17th, 2009, 04:55 AM
#1
Thread Starter
Addicted Member
Auto number in DataGridView + DataBinding
Hi all,
I'm having a problem in creating auto incremental column to DataGridView.
I have One DataGridView. One BindingSource. One DataTable.
1. I will get data from SQL Express 2005 and put it inside DataTable.
(Note: There is no auto number/incremental column in DB.)
2. Then I will Set my BindingSource = DataTable and GridView DataSource = BindingSource.
And Set AutoGeneratedColumn = False for GridView. (I have Pre-defined columns and their DataPropertyName is set accordingly to column name.)
After all this, my GridView display the data correctly.
What i'm facing now is I want to insert a column in DataGridView and its values will show the row count.
That is :
First row's column 1 value will be 1,
Second row's column 1 value will be 2 and
Third row's column 1 value will be 3, etc.
I am lack of such kind of knowledge.
Can anybody guide me, please ???
Thanks.
scsfdev.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|