我正在使用C#編寫一個數據包分析應用程序,並將數據包從網絡傳輸到datagridview,但一旦它開始填充,datagrivdview滾動變爲如下圖所示,我無法評分?我如何解決這個問題?Winforms Data Grid Scrolling問題
基本上問題是數據進入速度非常快,所以它可能無法處理它?
alt text http://img705.imageshack.us/img705/2681/gridviewscrollingissue.png
我手動和這裏填充數據是代碼:
string[] row = { packetsList[countOfPacketCaptures].packetType, packetsList[countOfPacketCaptures].sourceAddress, packetsList[countOfPacketCaptures].destinationAddress, packetsList[countOfPacketCaptures].sourcePort, packetsList[countOfPacketCaptures].destinationPort, packetsList[countOfPacketCaptures].packetMessage };
dgwPacketInfo.Rows.Add(row);
你正在觀看主UI線程或後臺線程上的數據包嗎? – 2010-02-19 02:40:07
後臺線程。 – itsaboutcode 2010-02-19 03:00:22
好的。也許你應該實現某種緩衝。 (看我的回答) – 2010-02-19 03:33:01