Remove the filter option in the gridcontrol title

Good afternoon.

I have a gridcontrol in a dialog. When I click on the gridcontrol title, the data is sorted in ascending order. I wanted to remove this option in the gridcontrol title, leaving the title “locked”. Does anyone know how to remove this?

You do not specify how you are creating the grid control - all code or using the GUI (partial construct).
The sort option is eliminated if you use DefaultGridDataModel.
See > Grid control headers sorting feature

This code was exactly what I needed. But, I put createUnoService(“”) and the data did not load. I use the code I found in that attached file.
Controle-tabela-dialogo.ods (16.1 KB)

Add to the IniciarDialogomacro the line




Based upon your design, the loading of the data is done when the button on the dialog is pressed.
Also do not see where you used DefaultGridDataModel in the code. Columns still sort.
Seeing as there is no response yet, here is the code to fix:


   'Criar controle tabela
   oTabela = oDialogo.Model.createInstance("")
   with oTabela
     .PositionX = 10
     .PositionY = 10
     .Width = 171
     .Height = 85
   end with


 	oDataModel = createUnoService("")
 ' Insert data
    oDataModel.addRow("1", array(""))
	oTabela.GridDataModel = oDataModel

After starting the dialog, press your button and your data appears without column sorting ability.

It worked out. Thank you very much.