I've scoured the documentation, but to no avail.
Is there any mechanism for saving the listitems of a ListView to either a file or char variable ?
Julian
While I'm at it, how do I sort the items ?? Frustration, thy name is Infragistics
I found this not so difficult to find out. It did cost some time, yes. Use the infragisticssite, google, the classbrowser and your imagination.
The code snippets could help you:
using Infragistics.Win.UltraWinListView.*
using System.Drawing.* from assembly.
define private variable hImageFolderOpen as Image no-undo.
create images in this way:
hImageFolderOpen = cast(new Bitmap(search('ofold.ico')), Image)
define variable hItem as UltraListViewItem no-undo.
DEFINE VARIABLE SubItemColumn AS UltraListViewSubItemColumn NO-UNDO.
DEFINE VARIABLE SubItem AS UltraListViewSubItem extent 2 NO-UNDO.
I have a listview with one 'MainColumn' and two 'SubItemColumns'
assign UltraListView:MainColumn:Text = "Caption"
listview:MainColumn:Width = 100
SubItemColumn = NEW UltraListViewSubItemColumn()
SubItemColumn:Width = 300
SubItemColumn:Text = "Action".
UltraListView:SubItemColumns:Add(SubItemColumn).
assign SubItemColumn = NEW UltraListViewSubItemColumn()
SubItemColumn:Width = 200
SubItemColumn:Text = "Menutype".
UltraListView:SubItemColumns:Add(SubItemColumn).
Now add items and subitems:
for each
by OrderField
on error undo, throw:
assign
subItem[1] = new UltraListViewSubItem()
subItem[1]:Value = some text
subItem[2] = new UltraListViewSubItem()
subItem[2]:Value = some other text
hItem = new UltraListViewItem(hObject, SubItem)
hItem:Value = some Caption
hItem:Appearance:Image = hImageControl
hItem:Key = some unique key
listview:Items:add(hItem).
end.
--
Kind regards,
Stefan Houtzager
Houtzager ICT consultancy & development
www.linkedin.com/in/stefanhoutzager
Thanks Stefan ,
What I was really after was a method to serialise the data, rather
than running through each item and adding to a char list (much like
WRITE-JSON on a temp-table)
It seems as if there aren't any.
Julian
On 25 March 2010 08:58, Stefan Houtzager
Ah, ok Julian, maybe you can ask on the infragisticsforum/do an enhancement request there. You saw the SaveAsXml/LoadFromXml methods in the classbrowser?
METHOD PUBLIC FINAL void SaveAsXml (filename AS character)
Member of Infragistics.Win.UltraWinListView.UltraListView
Summary:
Saves Infragistics.Win.UltraWinListView.UltraListView data into the specified file in XML (Soap) format.
Parameters:
--
Kind regards,
Stefan Houtzager
Houtzager ICT consultancy & development
www.linkedin.com/in/stefanhoutzager
I did, and discounted it because I thought that it contained all the
layout and settings for the control - but on close inspection of the
xml file, it seems to also include the actual items themselves
On 25 March 2010 13:52, Stefan Houtzager
You normally implement this by wrapping UltraListView and inheriting from ISerializable, but the implementation requires attirbute which is not supported by OE Architect.