在设置Selectable的时候如果被设置的Cell刚好是CurrentCell,MultiRow需要寻找一个新的位置去设定CurrentCell,性能的损耗就发生在同步CurrentCell的过程。所以
在循环设置Selectable属性之前调用以下代码.就可以避免MultiRow不停的同步CurrentCell。
C#- gcMultiRow1.CurrentCell = null;
- for (int i = 0; i < rowCount; i++)
- {
- for (int j = 0; j < cellCount; j++)
- {
- this.gcMultiRow1[i, j].Selectable = false;
- }
- }
复制代码 VB- gcMultiRow1.CurrentCell = Nothing
- For i As Integer = 0 To rowCount - 1
- For j As Integer = 0 To cellCount - 1
- Me.gcMultiRow1(i, j).Selectable = False
- Next
- Next
复制代码 希望可以帮助您解决这个问题。 |