Home
ProductsCustomers
About usContact
Purchase
Location: Products / Listview / Full API
Animated zoom toolbar
Horizontal and vertical split
Listview
Treeview
Window manager

Full API

This is the full object documentation for available functions, properties and events.

Properties
 

IDC_ListviewItem [] Listview.Items

Returns an array of all the items in the listview

IDC_ListviewItem [] Listview.SelectedItems

Returns an array of all the selected items in the listview

IDC_ListviewColumnHeader[] Listview.ColumnHeaders

Returns an array of the column headers in the listview

IDC_ListviewItemView[] Listview.ViewStyles

Returns an array of the available viewstyles for the listview

Bool Listview.EnableColumnFilters

Enables or disables filtering on columnheaders.
Note: This requires Listview.ResizeableColumnHeaders to be true.

Bool Listview.ResizeableColumnHeaders

Enables or disables if the columnheaders can be resized.

Bool Listview.MultiSelect

Enables or disables if the multiple items can be selected in the listview.

Bool Listview.Sortable

Enables or disables if the listview can be sorted.

IDC_ListviewColumnHeader Listview.SortingColumn

Set or get the sorting column for the listview.

bool Listview.SortDirectionAsc

Set the sorting direction to either ASCENDING or DECENDING.

Bool Listview.ShowLoading

Sets or gets if a “loading” text should be visible while loading and parsing data from an AJAX driven load.
Note: Listview.EnsureNoScriptTimeout must be true.

Bool Listview.EnsureNoScriptTimeout

Set if the listview should include an timer object, when parsing data, which removes the ”infamous” Javascript is still running warning.
Note: When enabling this property, the parse time of the listview may be prolonged. 
 

Methods
 

IDC_ListviewItem Listview.GetItemById(ID)

Returns the first listview item matching the ID

Void ClearSelected()

Deselects all selected items in the listview

Void ChangeView(int Index)

Change the view to a new view withing the range of Listview.ViewStyles

Void SetSize(int Width, int Height)

Change the size of the listview

IDC_ListviewItem AddItem(object Id, string Text, string[] Icons, string[] SubItems)

Adds a new listview item to the listview

Listview.AddItemsFromAJAX(string url, string[][] formPostArguments)

Load listview items from AJAX and inserts the result into the listview
Form Post arguments is added like this:

[['ID', '19994'],['CODE', 'ABCD']]

Pass null, if no form post arguments are needed.

Listview.AddItemsFromHTML(string HTML)

Bulk add data directly to the listview from html

Void PrintItems()

Prints all the items in the listview

Void PrintSelectedItems()

Prints the selected items in the listview

Void SelectItem(listviewItem)

Select a listviewItem

Void Clear()

Clear the listview of all listviewitems

IDC_ListviewColumnHeader AddColumnHeader(string Text,int Width, string Align, string DataType)

Adds a new column header

Void ClearColumnHeaders()

Removes all the column headers in the listview

Void SortItemsBy(ColumnHeader)

Sorts the listview by a distinct column

Void MoveSelectionUp()

Moves any selected items up in the listview

Void MoveSelectionDown()

Moves any selected items down in the listview


Events
 

Function Listview.OnDoubleClick(IDC_ListviewItem)

Is invoked when an item is doubleclicked.

Function Listview.OnSelect(IDC_ListviewItem)

Is invoked when an item is selected

Function Listview.OnLoad()

Invokes when an AJAX Load is completed

Function Listview.OnLoadFailed(string Errormessage)

Invokes when an AJAX load of items failes

Function Listview.OnParseComplete(int Count)

Is invoked when a parse of data is completed and the number of parsed items is passed with the function.

To assing a function to an event see this simple example:

function onListviewItemDoubleclick(item)
{
    alert('You have doubleclicked on ' + item.Items[0]);
}

Listview.OnDoubleClick = onListviewItemDoubleclick;

If you prefer, an inline function can be used too:

Listview.OnDoubleClick = function(item)
    {
        alert('You have double clicked on ' + item.Items[0]);
    };


Sub classes

IDC_ListviewItem

The listview item class, is the container class for each item in listview.

Properties
 

string[] ListviewItem.Items

Subitems for the listview item

string ListviewItem.Icon16

Sets or gets the 16x16 icon for the item

string ListviewItem.Icon32

Sets or gets the 32x32 icon for the item

string ListviewItem.Icon48

Sets or gets the 48x48 icon for the item

string ListviewItem.Icon64

Sets or gets the 64x64 icon for the item

string ListviewItem.Icon96

Sets or gets the 96x96 icon for the item

string ListviewItem.Icon128

Sets or gets the 128x128 icon for the item

string ListviewItem.Uniqueidentifier

Sets or gets the unique id for each item

Listview ListviewItem.Listview

Reference to the listview in which the item is located

bool ListviewItem.IsSelected

Gets if the item is selected or not
 

Methods
 

void ListviewItem.prototype.SetIcons(string[] Icons)

Change the icons for the item.
The array should point to images with the sizes:

  • 16x16
  • 32x32
  • 48x48
  • 64x64
  • 96x96
  • 128x128

You can exclude any sizes you don’t need for your listview, ie.

['images/icon16.gif','images/icon32.gif']

 

void ListviewItem.prototype.SetName(string name, int index)

Change the text for an item. The index indicates wich column item, that should be changed.

void ListviewItem.prototype.SetNames(string[] names)

Change all names for an item at once

void ListviewItem.prototype.Select()

Select the item

void ListviewItem.prototype.Remove()

Delete the item from the listview

string ListviewItem.prototype.ToHTML()

Convert the item back to HTML
 

IDC_ListviewColumnHeader

The column header class defines each column header in the listview.

Properties
 

Listview IDC_ListviewColumnHeader.Listview

Reference to the listview in which the column header is located

string IDC_ListviewColumnHeader.Name

Gets the name of the column header

int IDC_ListviewColumnHeader.Width

Gets the width of the column header

int IDC_ListviewColumnHeader.Index

Gets the index of the column header

bool IDC_ListviewColumnHeader.IsSortingColumn

Gets if the column header is the current sorting column

bool IDC_ListviewColumnHeader.SortAsc

Get if the column header is sorted ASCENDING or DESCENDING

string IDC_ListviewColumnHeader.DataType

Gets the data type of the column header

string IDC_ListviewColumnHeader.TextAlign

Gets the alignment of the column header
 

Methods
 

void IDC_ListviewColumnHeader.prototype.Remove()

Removes the column header
 

 

Copyright ® ID Web Controls - 2009 - 2010