How to format Data grid View on ASP.NET?
I am now working on Datagrid View on my sample开发者_如何学Python n-tier. How can i control it that it will not show all records on my query that maximize if i run my webpage.Or Control it size so it will retain its position like on the design.
Like on win forms that it will show scroll bars etch..
Can you give me any tips what will use and how it works?
It sounds like you're talking about paging. The DataGrid has a PageSize attribute, which determines the number of records displayed on each page. There are lots of samples of how to make a pager, but the basic gist is that you can either store the data in memory or limit the number of records you get from the database, and based on the page clicked you display the appropriate data.
You might need to set the autogenerate columns flag on the datagrid to false and work your way from there. That is, you should explicitly bind each field to each datagrid column. Wrt to the size, you should set the autosize attribute to false and provide the field sizes yourself.
精彩评论