DataGridView Winform Auto Insert Ordinal Column (Trick)
- by pang
I want to get some trick for this problem.
I have my table like this
Product (uuid, Name)
and one datagridview to display this information ( dataGridView.DataSouce = Products which is assign on runtime)
My problem is that I want to have "No" column on dataGridView which will show like below
No | Name
1 | ProdctA
2 | ProductB
3 | ProductC
What I do right now is create a "No" field on my product Model, and loop through all the row and assign value to it.
I think this is not a good solution.
Hope anyone can suggest better solution.
Thanks,