I've created a dialog and on this dialog, there is a gridcontrol, with colums and rows. I do that like this (code is Python) :
Code: Select all
class MyDlg(unohelper.Base, XDialogEventHandler, XMouseListener):
...
def show(self):
GridJobStatus = self.dialog.getControl('GridJobStatus')
GridModel = GridJobStatus.getModel()
columnmodel = GridModel.ColumnModel
GridDataModel = GridModel.GridDataModel
col = columnmodel.createColumn()
col.Title = "ID"
col.Identifier = "ID"
col.MaxWidth = ColSize
col.ColumnWidth = ColSize
columnmodel.addColumn(col)
etc for other columns...
I saw in the page https://wiki.openoffice.org/wiki/API/UN ... id_Control in "Feature Set" paragraph that "Each cell has its own data type", but I can't find any sample.
I try with :
Code: Select all
Button = _createUnoService("com.sun.star.form.component.CommandButton")
Button.Name = 'sName'
Button.Label = 'abc'
GridDataModel.addRow(None, [ClassJobUser.DataID, Button])
Many thanks for your answer.