incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tsutomu Uchino <hanya.r...@gmail.com>
Subject Re: How to use the SortableGridDataModel
Date Wed, 16 May 2012 16:11:01 GMT
2012/5/17 Fernand Vanrie <sos@pmgroup.be>:
> 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

Mime
View raw message