2012/5/17 Fernand Vanrie <[email protected]>:
> Does anyone know to use the SortableGridDataModel  with Basic  ?
Default data model for the grid control is SortableGridDataModel now,
so you do not need to replace it with other data model instance.

Sub Main
  d = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
  dm = d.getModel()
  gm = dm.createInstance("com.sun.star.awt.grid.UnoControlGridModel")
  gm.setPropertyValues(_
    array("Height", "PositionX", "PositionY", "Width"), _
    array(100, 0, 0, 100))
  dm.insertByName("grid", gm)
  gm.SelectionModel = com.sun.star.view.SelectionType.MULTI

  cm = gm.ColumnModel
  c = cm.createColumn()
  c.Title = "foo"
  cm.addColumn(c)
  dm = gm.GridDataModel
  dm.addRows(array("", "", ""), array(array("c"), array("b"), array("a")))

  d.execute()
  d.dispose()
End Sub

Click the row header to sort existing data.
>
> any hints are welcome
>
> Greetz
> Fernand

Best,
- Tsutomu

Reply via email to