-
Aug 24th, 2005, 05:05 AM
#1
Thread Starter
Member
[RESOLVED] How do I Auto Number a Datagrid Column
I have a data table which populates a datagrid on my form.
I want to add a column whcih will number the records automatically.
The user queries a database to get the number of records to be displayed in the datagrid through a stored procedure.
Any help please?
John
-
Aug 24th, 2005, 07:37 AM
#2
Re: How do I Auto Number a Datagrid Column
Hi jbanafful!
A way in witch you may do it, is by adding a unbound column in the DataGrid or add a dumy column in the binded DataTable.
Then Create your own DataGridTextBoxColumn, attach to this "dumy" column , and overrides the Paint event, in this event you may display the Rows Index value or whatever you wish
For more detail on How do I add an unbound column to a bound datagrid look here
And for more detail about creating your own Column derived from DataGridTextBoxColumn look here
-
Aug 24th, 2005, 07:39 AM
#3
Addicted Member
Re: How do I Auto Number a Datagrid Column
it looks like this:
VB Code:
DataGrid.DataSource = ds.Tables(0).Columns.Add("something")
if that helped me me out with this. how do i edit my datagrid?
-
Aug 25th, 2005, 05:45 AM
#4
Thread Starter
Member
Re: How do I Auto Number a Datagrid Column
I've solved it
I use the IDENTITY Function in TSQL to Load the data into the table.
It working well, thanks soo much
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
|