0

I am displaying data in TMS's TDBAdvGrid. In TMS's version 3 when clicking on the grid's header the data would be sorted in ascending or descending order of the clicked grid's column. In version 6 the same code doesn't sort the data anymore; nothing happens. It seems they changed something. Is there a way to make it work like before? Thank you.

  • PageMode, true makes it work like a normal grid. false it loads all the records and lets you sort etc. – Brian Jul 15 '19 at 19:13
  • PageMode was true. I made it false and then I can sort the grid fine. However, if I try to open the current row in an edit window the data displayed is the original one, not the sorted one, so the data set keeps the initial order whereas the grid gets sorted. In TMS's version 3.x both get sorted so I get the proper data when opening an edit form even after sorting. – Mihai Valcu Jul 15 '19 at 20:27
  • Read https://www.tmssoftware.com/site/pagemodedbadvgrid.asp section "Changing the DB cursor" which starts with : "It is by design that when grid.PageMode = false, the grid will not automatically move the DB cursor when selecting rows." – Brian Jul 15 '19 at 20:36
  • Thank you, Brian. I used PageMode = false in order to be able to sort the grid and when I want to edit one row while grid is sorted I get to the proper record in the dataset. I now have another problem: after I sort the grid the up & down glyphs display to show me the sorting order, which is fine. However, if I want to retrieve another data set the data comes ordered as it should from the database which is not what the glyphs indicate. Is there a way to hide the glyphs when I want to, like when retrieving new data which will no longer be sorted as per the glyphs? Thank you. – Mihai Valcu Jul 25 '19 at 15:08
  • 1
    Ad it looks like I solved it: after retrieving new data in the grid I call grid.Sort(0) which will keep the order in the query and removes the glyphs. – Mihai Valcu Jul 25 '19 at 15:33

0 Answers0