![]() |
C# code
This is cut off at the first for loop on our board, wonder whether we have a 'conflicting' hack:
internal void MoveRow_FromTo(int iRowSrc, int iRowDst) { if (this.tabTally.SelectedTab == this.tabBHA) { int iSeqNoSrc = (int)this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"]; int iSeqNoDst = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst, "SeqNo"]; if (iRowSrc > iRowDst) { this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst; int iSeQNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst,"SeqNo"]; for (int i = iRowDst; i <= iRowSrc-1; i++) { iSeQNo = iSeQNo+1; this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeQNo; } } else if (iRowDst == this.m_usctblBHAActivityAssetList.grd.Rows.Count-1) { int iSeqNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"]; this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst; for (int i = iRowSrc+1; i <= this.m_usctblBHAActivityAssetList.grd.Rows.Count-1; i++) { this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeqNo; iSeqNo = iSeqNo+1; } } else { int iSeqNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst+1, "SeqNo"]; this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst+1; for (int i = iRowDst+1; i <= this.m_usctblBHAActivityAssetList.grd.Rows.Count-1; i++) { iSeqNo = iSeqNo+1; this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeqNo; } } } else if (this.tabTally.SelectedTab == this.tabDrillString) { int iSeqNoSrc = (int)this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"]; int iSeqNoDst = (int)this.m_usctblActivityAssetList.grd[iRowDst, "SeqNo"]; if (iRowSrc > iRowDst) { this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst; int iSeQNo = (int)this.m_usctblActivityAssetList.grd[iRowDst,"SeqNo"]; for (int i = iRowDst; i <= iRowSrc-1; i++) { iSeQNo = iSeQNo+1; this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeQNo; } } else if (iRowDst == this.m_usctblActivityAssetList.grd.Rows.Count -1) { int iSeqNo = (int)this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"]; this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst; for (int i = iRowSrc+1; i <= this.m_usctblActivityAssetList.grd.Rows.Count-1; i++) { this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeqNo; iSeqNo = iSeqNo+1; } } else { int iSeqNo = (int)this.m_usctblActivityAssetList.grd[iRowDst+1, "SeqNo"]; this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst+1; for (int i = iRowDst+1; i <= this.m_usctblActivityAssetList.grd.Rows.Count-1; i++) { iSeqNo = iSeqNo+1; this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeqNo; } } } } Quote:
|
I find statements like:
for (int i = iRowSrc+1; i <= this.m_usctblActivityAssetList.grd.Rows.Count-1; i++) To be very suspicious. Are you sure that you aren't off by one there? Could you just compare i < Rows.Count rather than i<=Rows.Count-1 ? All those plus ones and minus ones are trouble. |
All times are GMT. The time now is 06:59 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|