How to add automatic growth columns to DataGrid
I think we all know how to add self-growth columns in the database, we can make this self-growth column to the DataGrid make the user easily know that it is the first few lines. Today I will introduce a database that can be easily displayed simply from growth. Method, some people may say that since the database supports us? I think two reasons: 1, not all the tables have self-growth columns. 2. The phenomenon of breaking is displayed when the self-growth column does not automatically copy, even if replication is possible. But first, this method is that this method can only display the serial number of the current page, that is, if there is a paging it can only mark the serial number of the current page. If you want to achieve a pagination, I want to use the database to be simpler than this method, because if you still use this method, you will have a status, here I don't consider this method, but I will give a database in the end of the article. solution. Ok, the following is a topic, first we need to place a DataGrid on the page. We use the Northwind database example: The DataGrid of the HTML page is as follows:
From the above process, we can see that we use Table Categories so we can generate a column of self-growth, which is starting from 1. What should I do if we want a column starting from 0? We can change the below in