Here, I recreated the issue for you (as am not allowed to share the source code).
Code: Select all
IncludePath "GridControls" : XIncludeFile "ExGRID\ExGRID.pbi"
Procedure.l CellCallback(exgrid,uMsg,*cellinfo.ExGRIDCellInfo)
Protected result,hWnd
Select uMsg
Case #ExGRID_FORMATCELL
*cellinfo\backcolour=RGB(255, 246, 81)
If *cellinfo\row<>-1 And *cellinfo\column<>-1 And *cellinfo\row=ExGRID_GetSelectedRow(exgrid)
*cellinfo\backcolour=RGB(81, 183, 255)
EndIf
*cellinfo\forecolour=0
result=#True
Default
result=#True
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0,#PB_Ignore,#PB_Ignore,640,480,"ExGrid",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
EditorGadget(0,10,10,512,128,#PB_Editor_ReadOnly):SetGadgetText(0,"Hold CTRL+A to add about 30 or so rows then hit CTRL+D to delete one by one."+#CRLF$+#CRLF$+"As soon as you get to the point where scrollbar needs to move up you'll notice the issue.")
StringGadget(1,522,10,110,350,"Fields",#PB_String_ReadOnly)
StringGadget(2,10,360,620,110,"Thumbnails",#PB_String_ReadOnly)
ContainerGadget(3,10,138,512,222)
Global *exgrid.ExGRID=ExGRID_Create(0,0,512,170,25,#ExGRID_GRIDLINES|#ExGRID_RESIZECOLUMNSTRUE|#ExGRID_SINGLELINETEXT|#ExGRID_ADDSTANDARDROWICONS)
With *exgrid
\AllowScreenUpdates(#False,#False)
\SetColumnHeader(25)
\SetRowHeader(40)
\SetOption(#ExGRID_ERASECOLOR,RGB(167, 167, 167))
\SetOption(#ExGRID_GRIDLINECOLOR,RGB(61, 61, 61))
\SetOption(#ExGRID_ROWHEADERMARGINCOLOR,RGB(167, 167, 167))
\SetOption(#ExGRID_SELECTEDCELLSCOLOR,RGB(255, 251, 174))
\SetOption(#ExGRID_SETCELLSELECTIONRANGE,#ExGRID_PROHIBITCELLSELECTION)
\SetOption(#ExGRID_SELECTIONBORDERWIDTH,2)
\SetOption(#ExGRID_SELECTIONBORDERCOLOR,RGB(255,0,0))
\AddColumn(-1,"Col1",100)
\AddColumn(-1,"Col2",100)
\AddColumn(-1,"Col3",100)
\AddColumn(-1,"Col4",100)
\CreateCellCallback(@CellCallback())
\AllowScreenUpdates(#True,#True)
\HideGrid(#False)
EndWith
CloseGadgetList()
SplitterGadget(4,10,10,512,468,0,3,#PB_Splitter_Separator)
SplitterGadget(5,10,10,622,350,4,1,#PB_Splitter_Separator|#PB_Splitter_Vertical)
SplitterGadget(6,10,10,620,460,5,2,#PB_Splitter_Separator)
SetGadgetState(5,510)
SetGadgetState(6,350)
AddKeyboardShortcut(0,#PB_Shortcut_Control|#PB_Shortcut_A,100)
AddKeyboardShortcut(0,#PB_Shortcut_Control|#PB_Shortcut_D,101)
Define rows.l
Repeat
Select WaitWindowEvent(100)
Case #PB_Event_CloseWindow:Break
Case #PB_Event_Menu
Select EventMenu()
Case 100
*exgrid\HideEditControls()
*exgrid\AllowScreenUpdates(#False)
rows=*exgrid\GetNumberOfRows()
While *exgrid\GetNumberOfRows():*exgrid\RemoveRow(0):Wend
For n=1 To rows+1
*exgrid\AddRow(-1,Str(n))
Next n
*exgrid\SelectCell(0,*exgrid\GetNumberOfRows()-1,#True,#True)
;InvalidateRect_(ExGRID_GethWnd(*exgrid),0,0)
*exgrid\AllowScreenUpdates(#True)
Case 101
*exgrid\HideEditControls()
*exgrid\AllowScreenUpdates(#False)
*exgrid\RemoveRow(*exgrid\GetNumberOfRows()-1)
rows=*exgrid\GetNumberOfRows()
While *exgrid\GetNumberOfRows():*exgrid\RemoveRow(0):Wend
For n=1 To rows
*exgrid\AddRow(-1,Str(n))
Next n
*exgrid\SelectCell(0,*exgrid\GetNumberOfRows()-1,#True,#True)
;InvalidateRect_(ExGRID_GethWnd(*exgrid),0,0)
*exgrid\AllowScreenUpdates(#True)
EndSelect
EndSelect
ForEver
EndIf
End
Please let me know if it is something that I do wrong. Note that I have used the same form layout I have in our application (nested containers), but it's not causing ExGrid to hiccup.
Thanks for taking a look at this.