Ask Your Question

How to use a gridcontrol in a dialog, as kind of multicolumn listbox

asked 2021-05-02 16:35:43 +0200

parsely gravatar image

updated 2021-05-03 12:22:08 +0200

In the GUI editing mode of dialogs there is an icon that says 'table control' when hoovering over it. Once inserted in the dialog the name GridControl is suggested. From the naming I expect that a kind of MainForm_Grid can be created, that can be populated with columns and rows either from Calc or Base.
That would be very suited to simulate a kind of multicolumn listbox, in case more information/sorting is desirable to make a selection.
However I don't see options to insert columns in the control, leave alone rows, nor can I find documentation for this control in help - wiki - guides - ask. In the API , there is no UnoControlxxxxModel entry that suggest the object I'm looking for, so a macro construction is blocked as well.

Any information is welcome, also that this concerns a future expansion?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2021-05-02 17:13:06 +0200

Ratslinger gravatar image

updated 2021-05-02 18:43:55 +0200


Yes, that is in fact a Grid control. Within a dialog there are no data aware controls. All data movement, in or out, must be done through macro code by the user.

For more information on this icon and more on the Grid control, please see my answer, links, and comments in this post -> Macro insert data into table control @dialog


Here are some links to documentation:

UNO Grid Control

GridColumn Service Reference

UnoControlGridModel Service Reference

DefaultGridDataModel.idl File Reference

As for future enhancements, as this control (not as icon) has been around for some time, not certain of any enhancements to be applied.

edit flag offensive delete link more

answered 2021-05-03 11:59:54 +0200

parsely gravatar image

updated 2021-05-03 16:05:05 +0200

OK @Ratslinger, that's what I was looking for, thanks. I have seen your BASIC example, and inspired by that, did transform it to Python code.
The uploaded file C:\fakepath\dialog.odt contains, embedded, your BASIC code and Python code for a dialog with GridControl. The macros are the first members of Tools in the menubar
I will also make a link to overhere in the post concerning the listener question you dealed with a week ago.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-05-02 16:35:43 +0200

Seen: 34 times

Last updated: May 03