I've used datagrids dozens of times (rarely is it easy). I've had scrolling problems before but they often "just went away" after closing LC and opening it back up later.
I've created a new datagrid that is behaving very strangely. It's a datagrid form with just two fields plus the background graphic and virtually no code to speak of, other than the essentials. When I update dgdata with the relevant array, the datagrid correctly shows the content of visible records immediately, but then my program becomes unresponsive for about 30 seconds. After the program is responsive again, I can click and highlight individual records, but the scrollbar is deactivated and doesn't work, and sorting by a key (I've tried many iterations) doesn't work. I can get data by line, but not by index, even though dgHilitedIndexes yields the correct index, dgDataOfIndex yields nothing (see below).
I'm baffled about all of this. I've been baffled for a week, and if I'm stuck after a week, which I am, I typically ask you guys for help. Any ideas would be greatly appreciated.
Main handler:
Code: Select all
set the dgdata of group "indicators" to tArrayFiltered
Code: Select all
get the dgHilitedLines of me
put the dgDataOfLine[it] of me into tData1 --no problem, array shows up as normal
get the dgHilitedIndexes of me
put the dgDataOfIndexes[it] of me into tData2 --should be the same data as tData1 but in fact it is empty
Code: Select all
on FillInData pArray
set the text of field "category" of me to pArray["Code"]
put toupper(pArray["EN title"]) into y
if the length of pArray["EN description"] < 3 then
set the text of field "Label" of me to y & "." && pArray["EN Example"]
else
set the text of field "Label" of me to y & "." && pArray["EN description"]
end if
end FillInData
Code: Select all
on LayoutControl pControlRect
set the rect of graphic "Background" of me to pControlRect
if the formattedheight of fld "label" of me > the height of fld "label" of me then
put min(the formattedheight of fld "label" of me,100) into x
set the height of fld "label" of me to x
set the top of fld "label" of me to the top of graphic "Background" of me
set the top of fld "category" of me to the top of graphic "Background" of me
set the height of graphic "Background" of me to x
set the top of graphic "Background" of me to the top of fld "label" of me
put the rect of graphic "Background" of me into pControlRect
end if
end LayoutControl