Skip to content

Commit 1e7386f

Browse files
Merge pull request #3517 from syncfusion-content/324496-dev-du-dr-lst
324496: Provide the dual listbox with drag and drop support sample in UG docs.
2 parents 6b20f84 + 7ffd295 commit 1e7386f

File tree

7 files changed

+66
-2
lines changed

7 files changed

+66
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using WebApplication1.Models;
7+
8+
namespace WebApplication1.Controllers
9+
{
10+
public class ListBoxController : Controller
11+
{
12+
public IActionResult dualdraglistbox()
13+
{
14+
ViewBag.groupA = new string[] { "Austrlia", "Bermuda", "Canada", "Cameroon", "Denmark", "France", "Finland", "Germany", "Hong kong" };
15+
ViewBag.groupB = new string[] { "India", "Italy", "Japan", "Mexico", "Norway", "Poland", "Switzerland", "United Kingdom", "United States" };
16+
ViewBag.items = new string[] { "moveUp", "moveDown", "moveTo", "moveFrom", "moveAllTo", "moveAllFrom" };
17+
return View();
18+
}
19+
}
20+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div style="width:50%; margin:auto">
2+
<div style="float:left; width:48%">
3+
@Html.EJS().ListBox("listbox1").DataSource((IEnumerable<object>)ViewBag.groupA).AllowDragAndDrop(true).Scope("#listbox2").ToolbarSettings(new Syncfusion.EJ2.DropDowns.ListBoxToolbarSettings { Items = ViewBag.items }).Render()
4+
</div>
5+
<div style="float:right; width:48%">
6+
@Html.EJS().ListBox("listbox2").DataSource((IEnumerable<object>)ViewBag.groupB).AllowDragAndDrop(true).Scope("#listbox2").Render()
7+
</div>
8+
</div>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div style="width:50%; margin:auto">
2+
<div style="float:left; width:48%">
3+
<ejs-listbox id="listbox1" dataSource="@ViewBag.groupA" allowDragAndDrop="true" scope="#listbox2" height="290px"></ejs-listbox>
4+
</div>
5+
<div style="float:right; width:48%">
6+
<ejs-listbox id="listbox2" dataSource="@ViewBag.groupB" allowDragAndDrop="true" scope="#listbox2" height="290px"></ejs-listbox>
7+
</div>
8+
</div>

ej2-asp-core-mvc/list-box/drag-and-drop.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,29 @@ In the following sample, the `allowDragAndDrop` property is set as `true` and `s
8989
{% endtabs %}
9090
{% endif %}
9191

92+
## Dual ListBox with drag and drop
93+
94+
The toolbar and drag and drop actions between two listboxes can be enabled by setting a listbox unique id and the same [`scope`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DropDowns.ListBox.html#Syncfusion_EJ2_DropDowns_ListBox_Scope) property value.
95+
96+
{% if page.publishingplatform == "aspnet-core" %}
97+
98+
{% tabs %}
99+
{% highlight cshtml tabtitle="CSHTML" %}
100+
{% include code-snippet/listbox/drag-drop/dual-drag/tagHelper %}
101+
{% endhighlight %}
102+
{% highlight c# tabtitle="Dragdrop.cs" %}
103+
{% include code-snippet/listbox/drag-drop/dual-drag/dualdraglistbox.cs %}
104+
{% endhighlight %}
105+
{% endtabs %}
106+
107+
{% elsif page.publishingplatform == "aspnet-mvc" %}
108+
109+
{% tabs %}
110+
{% highlight razor tabtitle="CSHTML" %}
111+
{% include code-snippet/listbox/drag-drop/dual-drag/razor %}
112+
{% endhighlight %}
113+
{% highlight c# tabtitle="Dragdrop.cs" %}
114+
{% include code-snippet/listbox/drag-drop/dual-drag/dualdraglistbox.cs %}
115+
{% endhighlight %}
116+
{% endtabs %}
117+
{% endif %}

ej2-asp-core-mvc/query-builder/how-to/state-persistence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: post
3-
title: State Persistence in ##Platform_Name## Query Builder Component
3+
title: State Persistence in ##Platform_Name## Query Builder Component | Syncfusion
44
description: Learn here all about State Persistence in Syncfusion ##Platform_Name## Query Builder component of Syncfusion Essential JS 2 and more.
55
platform: ej2-asp-core-mvc
66
control: State Persistence

ej2-asp-core-mvc/query-builder/how-to/summary-view.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: post
3-
title: SummaryView in ##Platform_Name## QueryBuilder Component
3+
title: SummaryView in ##Platform_Name## QueryBuilder Component | Syncfusion
44
description: Learn here all about Summary View in Syncfusion ##Platform_Name## QueryBuilder component of Syncfusion Essential JS 2 and more.
55
platform: ej2-asp-core-mvc
66
control: Summary View
@@ -34,3 +34,5 @@ Summary view allows you to show or hide the filtered query. By default, the valu
3434
{% endhighlight %}
3535
{% endtabs %}
3636
{% endif %}
37+
38+
![Query builder Sample](../images/summary-view.png)
Loading

0 commit comments

Comments
 (0)