How to save user preferences / settings for .NET & Ultra

Posted by julian.garde@g2DataSystems.co.uk on 20-Jul-2009 06:05

I may have missed something, but I am unable to see how I can save various settings which I would like users to be able to select.

A simple example might be the background colour associated with a certain status, for cells in a report grid or ultragrid, .

 

e.g. Infragistics.Documents.Graphics.Brushes:WhiteSmoke.

In Visual Studio one can use the application settings to save settings of any type. Is there a simple way to do this is Progress?

All Replies

Posted by jquerijero on 22-Jul-2009 14:30

I believe you will have to write that piece in GUI for .NET.

Posted by julian.garde@g2DataSystems.co.uk on 22-Jul-2009 16:24

I can't really see how to do this.  How would you save a class or property to a file or the database.?

Posted by Thomas Mercer-Hursh on 22-Jul-2009 16:40

A class, no, but a property is just a value like any other value, i.e., like a database field.  You can save them as fixed fields, name/value pairs, or write out some XML.

Posted by julian.garde@g2DataSystems.co.uk on 22-Jul-2009 17:50

I am still unable to see how to resolve the problem.

In the example below.  What I wish to do is initialise the cellBackground from a stored value.

Background is a property of the cellPattern, but is an instance of a background object. (is that right?)

DEFINE VARIABLE cellBackGround AS Infragistics.Documents.Report.Background NO-UNDO.

cellBackGround =

cellBackGround = NEW Background(Infragistics.Documents.Graphics.Brushes:White).

cellPattern:

cellPatten:BACKGROUND = cellBackGround.

Posted by jquerijero on 23-Jul-2009 11:21

I haven't tried this in Progress GUI for .NET, but this is how I load Enum values from a String in Visual Studio (code is converted to ABL language).

DEFINE VARIABLE cellBackGround AS Infragistics.Documents.Report.Background NO-UNDO.

cellBackGround = CAST(System.Enum.Parse(Progress.Util.TypeHelper:GetType("Infragistics.Documents.Report.Background"), "WhiteSmoke"), Infragistics.Documents.Report.Background).

"WhiteSmoke" is your stored setting.

Posted by Eric Girardet on 21-Nov-2009 04:51

Hi,

you may use the standard Infragistics toolbox to save the user layout. All main objects are serializable, so they can be saved in XML format, look this example to save:

this-object:UltraGrid1:DisplayLayout:SaveAsXml(

        "C:\\Users\\eric\\Documents\\savedLayout.xml",

        Infragistics.Win.UltraWinGrid.PropertyCategories:All).

And to load :

this-object:UltraGrid1:DisplayLayout:LoadFromXml(

       "C:\\Users\\eric\\Documents\\savedLayout.xml",

       Infragistics.Win.UltraWinGrid.PropertyCategories:All).

Me I'm saving the XML file and then I store it in my database for each user, I use those file *as temporary files*.

Hope it's help!

Best regards,

Eric

Posted by vrtik on 09-Jun-2010 09:15

Hi

Would it be possible to send me the code you are using to save xml in your database please.

Regards

Peter

Posted by Admin on 09-Jun-2010 09:19

Have a look at the COPY-LOB statement.

Posted by vrtik on 09-Jun-2010 09:53

Thanks Mike

I actually have this problem

http://communities.progress.com/pcom/thread/25179?tstart=0

This thread is closed