数据绑定到Gridview 1条记录1条记录
我有一个问题,它绑定大量数据,客户希望数据按1显示1.这意味着,如果我在数据集中有100000条记录,并且如果我绑定到datagridview,它需要等待很长时间才能显示出来.我需要问的是,是否有可能使数据显示为1比1?这意味着当它有10000条记录时,当第1条记录绑定到时,网格将显示1条记录,第2条记录绑定到时,网格将再添加1条记录,依此类推.而不是等到10000条记录中的所有绑定才显示结果.
i have a question which binding a huge set of data, and the client wish the data display out 1 by 1. Which means, if i have 100000 records in the dataset, and if i bind to the datagridview, it need to wait long time to display out. What I need to ask is, is it possible to make the data display 1 by 1? It means when it have 10000 records, when 1st record bind in, the grid will display 1 record, 2nd record bind in, grid will add 1 more record, and so on. Instead of wait until 10000 records all binding in only display out the result. is it possible ?
使用分页,请参见此处:
DataGrid分页-C#Windows窗体 [ http://www.developerfusion.com/article/5292/datagridgridview -paging-and-sorting-using-a-datareader/ [ http://msdn.microsoft.com/en-us/library/aa713421%28v = vs.71%29.aspx [ ^ ]
Use paging, see here :
DataGrid Paging - C# Windows Forms[^]
http://www.developerfusion.com/article/5292/datagridgridview-paging-and-sorting-using-a-datareader/[^]
http://msdn.microsoft.com/en-us/library/aa713421%28v=vs.71%29.aspx[^]