Hi Fernand,
> I hope Frank is still there :-)
forcing me to answer your mails this way won't work forever :)
> I Try to change the column format in a Data Source Browser
> I used following code with no suces, the Formatkey off the column
> properties is changed but no visual changes
>
> oModel = oDataSourcebrowser.com_sun_star_awt_XTabController_getModel
>
> oMOdel.columns.getbyname("docdat").setpropertyvalue("FormatKey",2) '
> 2 = DATE
> oMOdel.reset
> omodel.reload
Try omitting the "columns". What you access here is the *database
column*, not the *grid column*.
That is, oModel is an css.sdb.RowSet, which is a ResultSet, which
provides the XColumnsSupplier interface, giving you access to the single
columns of this result set. Those columns also support a FormatKey
property, but the grid columns are not expected to react on their changes.
On the other hand, "oModel.getByName( <gridcolumnname> )" would give you
the *grid column*. Usually, every grid column is bound to a result set
column (in that it fetches from and stores to this result set column).
Upon creating the grid column and binding it to a result set column, the
FormatKey from the latter is transferred to the former, but there's no
life connection.
So, a
oModel.getByName( <gridcolname >).setPropertyValue( "FormatKey", 2 )
should do.
Ciao
Frank
--
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems http://www.sun.com/staroffice -
- OpenOffice.org Base http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]