在加了的WIN FROM中DATAGRID在左示的
以下在上查找到的代,可以示行,但量比多,如,需要,如何化?
private void dataGrid1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
int row =1;
int y = 0;
if(this.currentDataSet != null)
{
int count =this.currentDataSet.Tables[0].Rows.Count;
while( row <= count)
{
//get & draw the header text...
string text = string.Format( " {0} ", row);
y = this.dataGrid1.GetCellBounds(row - 1, 0).Y + 2;
e.Graphics.DrawString(text,this.dataGrid1.Font, new SolidBrush(Color.Black),2,y);
row ++;
}
}
}
[解决办法]
用虚表,你的问题我也遇到过,
我最多显示5万条数据在表格里,不用10秒就可以反映出来
但显示不全部装载,只装载看得的那一部分
当客户拉动滚动条时再显示他想看的东西,
当然DataGrid是不支持的,我用提第三方控件来实现的
Farpoint spread
这个解决办法也是在这个控件公司的技术论坛上看到的:)