Timeline
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays an ordered vertical activity feed with markers, time, detail, and optional hosted content.
- C#
- VB.NET
public class Timeline : Control
Public Class Timeline
Inherits Control
Item order is preserved. MaxItems limits display without deleting data. Bound lists own collection structure.
Example:
var timeline = new Timeline { Grouping = TimelineGrouping.ByDay, TimeFormat = "HH:mm" };
timeline.Items.Add(new TimelineItem(DateTime.Now, "Deployment finished")
{
Description = "All nodes are healthy.",
Tone = TimelineTone.Success,
Content = new Button { Text = "View details", Height = 32 }
});
timeline.ItemClick += (sender, e) => MessageBox.Show(e.Item.Title);
this.Controls.Add(timeline);
Constructors
Timeline()
Initializes an empty timeline with a 100-row display limit.
Properties
ContentMember
String: Gets or sets the hosted control property name. Empty looks for Content. (Default: "")
DataMember
String: Gets or sets the list path within DataSource. Empty uses the source itself. (Default: "")
DataSource
Object: Gets or sets an IList, IListSource, BindingSource, or an object resolved through DataMember. (Default: null)
IBindingList and collection/item notifications refresh automatically. Call RefreshData after structural changes to a plain list. Perform source updates in the owning Wisej session using the application's usual session update mechanism. While bound, modify source records instead of Items. Editing a generated item does not write back to the source and is overwritten by the next refresh.
Example:
var records = new System.ComponentModel.BindingList<TimelineItem>();
timeline.DataSource = records; // Conventional names Time, Title, Description, etc. are used.
records.Add(new TimelineItem(DateTime.Now, "Connected"));
records[0].Description = "Connection verified."; // Item notifications refresh the view.
DefaultSize
Size: Gets the default timeline size of 420 by 280 pixels.
DescriptionMember
String: Gets or sets the description property name. Empty looks for Description. (Default: "")
Focusable
Boolean: Gets or sets outer-container focusability. The default is false. (Default: False)
Grouping
TimelineGrouping: Gets or sets date grouping. The default is None. ByDay never reorders entries. (Default: None)
HasMoreItems
Boolean: Gets or sets whether more data can be requested. The default is true. (Default: True)
The button is shown when this property is true. Handle LoadMore or override OnLoadMore to supply older items.
IconMember
String: Gets or sets the icon source property name. Empty looks for Icon. (Default: "")
Items
TimelineItemCollection: Gets the ordered activity entries. Structural changes are prohibited while DataSource is set.
LoadMoreText
String: Gets or sets the localized load-more button caption. (Default: null)
Null uses the built-in text for the current UI culture. An empty string suppresses the text.
MaxItems
Int32: Gets or sets the positive maximum number of displayed items. The default is 100. (Default: 100)
This is a display limit; the collection and bound source are not truncated.
ShowConnector
Boolean: Gets or sets whether adjacent items in a group are connected. The default is true. (Default: True)
TabStop
Boolean: Gets or sets tab participation for the outer container. The default is false; interactive children remain reachable. (Default: False)
TagMember
String: Gets or sets the application tag property name. Empty looks for Tag. (Default: "")
TimeFormat
String: Gets or sets a .NET timestamp format. The default is HH:mm; formatting uses the current culture. (Default: "HH:mm")
Throws:
- FormatException The format is invalid.
TimeMember
String: Gets or sets the timestamp property name. Empty looks for Time. (Default: "")
TimePosition
TimelineTimePosition: Gets or sets timestamp placement. The default is Left, mirrored in RTL. (Default: Left)
TitleMember
String: Gets or sets the title property name. Empty looks for Title. (Default: "")
Example:
timeline.TimeMember = "OccurredAt";
timeline.TitleMember = "Message";
timeline.DescriptionMember = "Detail";
// Set DataSource to a list whose records expose these properties.
ToneMember
String: Gets or sets the tone property name. Empty looks for Tone. (Default: "")
Methods
Dispose(disposing)
Unsubscribes from source and item notifications, then disposes hosted controls through Control.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | Whether managed resources should be released. |
OnDataSourceChanged(e)
Raises DataSourceChanged.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnItemClick(e)
Raises ItemClick for a current displayed activity.
| Parameter | Type | Description |
|---|---|---|
| e | TimelineItemEventArgs | Clicked item and source information. |
OnLoadMore(e)
Raises LoadMore.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnWebEvent(e)
Dispatches client events to their processing methods.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event. |
OnWebRender(config)
Serializes a versioned view; source records and tags remain on the server.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
Prepend(item)
Inserts an unbound item at the start. While bound, insert into the source list instead.
| Parameter | Type | Description |
|---|---|---|
| item | TimelineItem | Non-null activity not already owned by a collection. |
Example:
timeline.Prepend(new TimelineItem(DateTime.Now, "New activity"));
// When bound, insert into the source instead of modifying Items:
var records = new System.ComponentModel.BindingList<TimelineItem>();
timeline.DataSource = records;
records.Insert(0, new TimelineItem(DateTime.Now, "New bound activity"));
RefreshData()
Rebuilds items from the current source, for plain lists without change notifications.
Example:
var records = new System.Collections.Generic.List<TimelineItem>();
timeline.DataSource = records;
records.Add(new TimelineItem(DateTime.Now, "Added to a plain list"));
timeline.RefreshData(); // List<T> does not notify when its structure changes.
Events
DataSourceChanged
EventHandler Occurs after DataSource changes and its items are rebuilt.
ItemClick
EventHandler<TimelineItemEventArgs> Occurs when an item header is clicked or activated with Enter or Space.
LoadMore
EventHandler Occurs when the user requests older activities through the Load more button.
Append older data and, when exhausted, set HasMoreItems to false. Loading and source paging are application responsibilities.
Example:
timeline.LoadMore += (sender, e) =>
{
// In a real application, retrieve the next page from your data source here.
timeline.Items.Add(new TimelineItem(DateTime.Today.AddDays(-1), "Older activity"));
timeline.HasMoreItems = false; // This example has no further pages.
};
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |