|
| 1 | + --- |
| 2 | +layout: post |
| 3 | +title: Items in ##Platform_Name## Timeline Control | Syncfusion |
| 4 | +description: Checkout and learn about Items in Syncfusion ##Platform_Name## Timeline control of Syncfusion Essential JS 2 and more. |
| 5 | +platform: ej2-asp-core-mvc |
| 6 | +control: Items |
| 7 | +publishingplatform: ##Platform_Name## |
| 8 | +documentation: ug |
| 9 | +--- |
| 10 | + |
| 11 | +# Items in ##Platform_Name## Timeline control |
| 12 | + |
| 13 | +The Timeline items can be added by using the [items](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Layouts.Timeline.html#Syncfusion_EJ2_Layouts_Timeline_Items) property. Each item can be configured with options such as `content`, `oppositeContent`, `dotCss`, `disabled` and `cssClass`. |
| 14 | + |
| 15 | +## Adding content |
| 16 | + |
| 17 | +You can define the item content using the [content](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Layouts.TimelineItem.html#Syncfusion_EJ2_Layouts_TimelineItem_Content) property. |
| 18 | + |
| 19 | +### String content |
| 20 | + |
| 21 | +You can define string content for the Timeline items. |
| 22 | + |
| 23 | +{% if page.publishingplatform == "aspnet-core" %} |
| 24 | + |
| 25 | +{% tabs %} |
| 26 | +{% highlight cshtml tabtitle="CSHTML" %} |
| 27 | +{% include code-snippet/timeline/items/content/string-based/tagHelper %} |
| 28 | +{% endhighlight %} |
| 29 | +{% highlight c# tabtitle="Separator.cs" %} |
| 30 | +{% include code-snippet/timeline/items/content/string-based/stringbased.cs %} |
| 31 | +{% endhighlight %} |
| 32 | +{% endtabs %} |
| 33 | + |
| 34 | +{% elsif page.publishingplatform == "aspnet-mvc" %} |
| 35 | + |
| 36 | +{% tabs %} |
| 37 | +{% highlight razor tabtitle="CSHTML" %} |
| 38 | +{% include code-snippet/timeline/items/content/string-based/razor %} |
| 39 | +{% endhighlight %} |
| 40 | +{% highlight c# tabtitle="Separator.cs" %} |
| 41 | +{% include code-snippet/timeline/items/content/string-based/stringbased.cs %} |
| 42 | +{% endhighlight %} |
| 43 | +{% endtabs %} |
| 44 | +{% endif %} |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +### Templated content |
| 49 | + |
| 50 | +You can specify the [Template Content](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Layouts.TimelineItem.html#Syncfusion_EJ2_Layouts_TimelineItem_ContentTemplate) content for the items, by using the selector for an element in HTML. |
| 51 | + |
| 52 | +{% if page.publishingplatform == "aspnet-core" %} |
| 53 | + |
| 54 | +{% tabs %} |
| 55 | +{% highlight cshtml tabtitle="CSHTML" %} |
| 56 | +{% include code-snippet/timeline/items/content/template-based/tagHelper %} |
| 57 | +{% endhighlight %} |
| 58 | +{% highlight c# tabtitle="Separator.cs" %} |
| 59 | +{% include code-snippet/timeline/items/content/template-based/templatebased.cs %} |
| 60 | +{% endhighlight %} |
| 61 | +{% endtabs %} |
| 62 | + |
| 63 | +{% elsif page.publishingplatform == "aspnet-mvc" %} |
| 64 | + |
| 65 | +{% tabs %} |
| 66 | +{% highlight razor tabtitle="CSHTML" %} |
| 67 | +{% include code-snippet/timeline/items/content/template-based/razor %} |
| 68 | +{% endhighlight %} |
| 69 | +{% highlight c# tabtitle="Separator.cs" %} |
| 70 | +{% include code-snippet/timeline/items/content/template-based/templatebased.cs %} |
| 71 | +{% endhighlight %} |
| 72 | +{% endtabs %} |
| 73 | +{% endif %} |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +## Adding opposite content |
| 78 | + |
| 79 | +You can add additional information to each Timeline item, by using the [oppositeContent](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Layouts.TimelineItem.html#Syncfusion_EJ2_Layouts_TimelineItem_OppositeContent) property which is positioned opposite to the item content. Similar to the `content` property you can define `string` or `function` as contents to the oppositeContent. |
| 80 | + |
| 81 | +{% if page.publishingplatform == "aspnet-core" %} |
| 82 | + |
| 83 | +{% tabs %} |
| 84 | +{% highlight cshtml tabtitle="CSHTML" %} |
| 85 | +{% include code-snippet/timeline/items/opposite-content/tagHelper %} |
| 86 | +{% endhighlight %} |
| 87 | +{% highlight c# tabtitle="Separator.cs" %} |
| 88 | +{% include code-snippet/timeline/items/opposite-content/oppositecontent.cs %} |
| 89 | +{% endhighlight %} |
| 90 | +{% endtabs %} |
| 91 | + |
| 92 | +{% elsif page.publishingplatform == "aspnet-mvc" %} |
| 93 | + |
| 94 | +{% tabs %} |
| 95 | +{% highlight razor tabtitle="CSHTML" %} |
| 96 | +{% include code-snippet/timeline/items/opposite-content/razor %} |
| 97 | +{% endhighlight %} |
| 98 | +{% highlight c# tabtitle="Separator.cs" %} |
| 99 | +{% include code-snippet/timeline/items/opposite-content/oppositecontent.cs %} |
| 100 | +{% endhighlight %} |
| 101 | +{% endtabs %} |
| 102 | +{% endif %} |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +## Dot item |
| 107 | + |
| 108 | +You can define CSS class to set icons, background colors, or images to personalize the appearance of dots associated with each Timeline item by using the [dotCss](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Layouts.TimelineItem.html#Syncfusion_EJ2_Layouts_TimelineItem_DotCss) property. |
| 109 | + |
| 110 | +### Adding icons |
| 111 | + |
| 112 | +You can define the CSS class to show the icon for each item using the `dotCss` property. |
| 113 | + |
| 114 | +### Adding images |
| 115 | + |
| 116 | +You can include images for the Timeline items using the `dotCss` property, by setting the CSS `background-image` property. |
| 117 | + |
| 118 | +### Adding text |
| 119 | + |
| 120 | +You can display text for the Timeline items using the `dotCss` property, by adding text to the CSS `content` property. |
| 121 | + |
| 122 | +{% if page.publishingplatform == "aspnet-core" %} |
| 123 | + |
| 124 | +{% tabs %} |
| 125 | +{% highlight cshtml tabtitle="CSHTML" %} |
| 126 | +{% include code-snippet/timeline/items/dot-item/tagHelper %} |
| 127 | +{% endhighlight %} |
| 128 | +{% highlight c# tabtitle="Separator.cs" %} |
| 129 | +{% include code-snippet/timeline/items/dot-item/dotitem.cs %} |
| 130 | +{% endhighlight %} |
| 131 | +{% endtabs %} |
| 132 | + |
| 133 | +{% elsif page.publishingplatform == "aspnet-mvc" %} |
| 134 | + |
| 135 | +{% tabs %} |
| 136 | +{% highlight razor tabtitle="CSHTML" %} |
| 137 | +{% include code-snippet/timeline/items/dot-item/razor %} |
| 138 | +{% endhighlight %} |
| 139 | +{% highlight c# tabtitle="Separator.cs" %} |
| 140 | +{% include code-snippet/timeline/items/dot-item/dotitem.cs %} |
| 141 | +{% endhighlight %} |
| 142 | +{% endtabs %} |
| 143 | +{% endif %} |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | +## Disabling items |
| 148 | + |
| 149 | +You can use the [disabled](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Layouts.TimelineItem.html#Syncfusion_EJ2_Layouts_TimelineItem_Disabled) property to disable an item when set to `true`. By default, the value is `false`. |
| 150 | + |
| 151 | +{% if page.publishingplatform == "aspnet-core" %} |
| 152 | + |
| 153 | +{% tabs %} |
| 154 | +{% highlight cshtml tabtitle="CSHTML" %} |
| 155 | +{% include code-snippet/timeline/items/disabled/tagHelper %} |
| 156 | +{% endhighlight %} |
| 157 | +{% highlight c# tabtitle="Separator.cs" %} |
| 158 | +{% include code-snippet/timeline/items/disabled/disabled.cs %} |
| 159 | +{% endhighlight %} |
| 160 | +{% endtabs %} |
| 161 | + |
| 162 | +{% elsif page.publishingplatform == "aspnet-mvc" %} |
| 163 | + |
| 164 | +{% tabs %} |
| 165 | +{% highlight razor tabtitle="CSHTML" %} |
| 166 | +{% include code-snippet/timeline/items/disabled/razor %} |
| 167 | +{% endhighlight %} |
| 168 | +{% highlight c# tabtitle="Separator.cs" %} |
| 169 | +{% include code-snippet/timeline/items/disabled/disabled.cs %} |
| 170 | +{% endhighlight %} |
| 171 | +{% endtabs %} |
| 172 | +{% endif %} |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | +## CSS class |
| 177 | + |
| 178 | +The [cssClass](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Layouts.TimelineItem.html#Syncfusion_EJ2_Layouts_TimelineItem_CssClass) property allows you to define a custom class to modify the appearance of the Timeline item. |
0 commit comments