Serial Number In Datagridview Vb Net

 
Serial Number In Datagridview Vb Net Average ratng: 3,7/5 6985 reviews
Active2 years, 6 months ago

Here is a method to auto number using a DGV that is not bound to a data source. The code places the auto numbering in column zero. Place a DataGridView on the form and add the desired number of columns.

i am using windows application with C#.I want to display Serial number in datagridview.

Benjamin
17k31 gold badges134 silver badges245 bronze badges
Narottam MakvanaNarottam Makvana

3 Answers

You need to bind DataBindingComplete event of datagridview.

It's work for me.

Krushnakant LadaniKrushnakant Ladani
How

In WinForms Applications, to display the row number in the row header, we could use the RowPostPaint event of DataGridView control.

Usage: Suppose grid is named as dgvUserDetails

Delegate

Code

Don’t try to manipulate the Code part much because the X and Y are calculated co-ordinates in the row header area or you can customizse test it yourself to see the various results. Trio stealth tablet.

Result

Durgesh Pandey

Serial Number In Datagridview Vb Net Access

Durgesh Pandey

Vb Net Datagridview

1,5282 gold badges20 silver badges36 bronze badges

Refresh Datagridview Vb

ShahidShahid

Not the answer you're looking for? Browse other questions tagged c#winformsdatagridview or ask your own question.