Skip to content

Commit 75639e1

Browse files
Merge pull request #3217 from Syncfusion-Content/hotfix/hotfix-v26.1.35
DOCINFRA-2341_merged_using_automation
2 parents 46e4580 + 8901760 commit 75639e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1086
-673
lines changed
Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
@Html.EJS().Grid("AutoWrap").DataSource((IEnumerable<object>)ViewBag.dataSource).AllowTextWrap().Columns(col =>
1+
<div style="display: flex">
2+
<label style="padding: 10px 10px 26px 0"> Change the wrapmode of auto wrap feature: </label>
3+
<span style="height:fit-content">
4+
@Html.EJS().DropDownList("Wrap").Width("180px").DataSource(new List<object> { "Both", "Content" }).Change("change").Render()
5+
</span>
6+
</div>
7+
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).AllowTextWrap().Columns(col =>
28
{
9+
col.Field("Inventor").HeaderText("Inventor Name").Width("150").Add();
310

4-
col.Field("NumberofPatentFamilies").HeaderText("NumberofPatentFamilies").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
5-
col.Field("Inventor").HeaderText("Inventor").Width("150").Add();
6-
col.Field("NumberofINPADOCpatents").HeaderText("NumberofINPADOCpatents").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
7-
col.Field("Mainfieldsofinvention").HeaderText("Mainfieldsofinvention").Width("150").Add();
8-
col.Field("Active").HeaderText("Active").Width("150").Add();
11+
col.Field("NumberOfPatentFamilies").HeaderText("Number of Patent Families").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
12+
col.Field("Country").HeaderText("Country").Width("150").Add();
13+
col.Field("Active").HeaderText("Active").Width("150").Add();
914

10-
}).AllowPaging().TextWrapSettings(text => { text.WrapMode(Syncfusion.EJ2.Grids.WrapMode.Content);}).Render()
15+
}).TextWrapSettings(text => { text.WrapMode(Syncfusion.EJ2.Grids.WrapMode.Content); }).Render()
16+
17+
<script>
18+
function change(args) {
19+
var grid = document.getElementById("Grid").ej2_instances[0];
20+
grid.textWrapSettings.wrapMode = args.value;
21+
}
22+
</script>
Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" gridLines="Default" height="315" allowTextWrap="true">
2-
<e-grid-textwrapsettings wrapMode="Content"></e-grid-textwrapsettings>
1+
<div style="display: flex">
2+
<label style="padding: 10px 10px 26px 0"> Change the wrapmode of auto wrap feature: </label>
3+
<span style="height:fit-content">
4+
<ejs-dropdownlist id="dropdown" dataSource="@ViewBag.dropdownData" change="Change"></ejs-dropdownlist>
5+
</span>
6+
</div>
7+
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" allowTextWrap=true>
8+
<e-grid-textwrapsettings wrapMode="Content"></e-grid-textwrapsettings>
39
<e-grid-columns>
4-
<e-grid-column field="RoolNo" headerText="Rool No" textAlign="Right" width="120"></e-grid-column>
5-
<e-grid-column field="Name" headerText="Name of the inventor" width="100"></e-grid-column>
6-
<e-grid-column field="patentfamilies" headerText="No of patentfamilies" width="130"></e-grid-column>
7-
<e-grid-column field="Country" headerText="Country" width="130"></e-grid-column>
8-
<e-grid-column field="mainfields" headerText="Main fields of Invention" width="150"></e-grid-column>
10+
<e-grid-column field="Inventor" headerText="Inventor Name" textAlign="Right" width="120"></e-grid-column>
11+
<e-grid-column field="NumberOfPatentFamilies" headerText="Number of Patent families" textAlign="Right" width="120"></e-grid-column>
12+
<e-grid-column field="Country" headerText="Country" width="150"></e-grid-column>
13+
<e-grid-column field="Active" headerText="Active" textAlign="Right" width="150"></e-grid-column>
914
</e-grid-columns>
10-
</ejs-grid>
15+
</ejs-grid>
16+
17+
<script type="text/javascript">
18+
function Change(args) {
19+
var grid = document.getElementById("Grid").ej2_instances[0];
20+
grid.textWrapSettings.wrapMode = args.value;
21+
}
22+
</script>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
public IActionResult Index()
22
{
3-
var Order = OrderDetails.GetAllRecords();
3+
var Order = InventorDetails.GetAllRecords();
44
ViewBag.DataSource = Order;
5+
ViewBag.dropdownData = new string[] { "Clip", "Ellipsis", "EllipsisWithTooltip" };
56
return View();
6-
}
7+
}
Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1-
@Html.EJS().Grid("ClipMode").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
2-
{
3-
col.Field("NumberofPatentFamilies").HeaderText("NumberofPatentFamilies").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
4-
col.Field("Inventor").HeaderText("Inventor").ClipMode(Syncfusion.EJ2.Grids.ClipMode.Clip).Width("150").Add();
5-
col.Field("NumberofINPADOCpatents").ClipMode(Syncfusion.EJ2.Grids.ClipMode.Ellipsis).HeaderText("NumberofINPADOCpatents").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
6-
col.Field("Mainfieldsofinvention").ClipMode(Syncfusion.EJ2.Grids.ClipMode.EllipsisWithTooltip).HeaderText("Mainfieldsofinvention").Width("150").Add();
7-
col.Field("Active").HeaderText("Active").Width("150").Add();
8-
}).AllowPaging().Render()
1+
2+
<div style="display: flex">
3+
<label style="padding: 10px 10px 26px 0">Change the clip mode: </label>
4+
<span style="height:fit-content">
5+
@Html.EJS().DropDownList("ClipMode").Width("180px").DataSource(new List<object> { "Clip", "Ellipsis", "EllipsisWithTooltip" }).Change("change").Render()
6+
</span>
7+
8+
</div>
9+
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
10+
{
11+
col.Field("NumberOfPatentFamilies").HeaderText("NumberofPatentFamilies").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
12+
col.Field("Inventor").HeaderText("Inventor").Width("150").Add();
13+
col.Field("NumberOfINPADOCPatents").HeaderText("NumberofINPADOCpatents").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
14+
col.Field("MainFieldsOfInvention").HeaderText("Mainfieldsofinvention").Width("150").Add();
15+
col.Field("Active").HeaderText("Active").Width("150").Add();
16+
}).Render()
17+
18+
<script>
19+
function change(args) {
20+
var grid = document.getElementById("Grid").ej2_instances[0];
21+
grid.getColumnByField('MainFieldsOfInvention').clipMode = args.value;
22+
grid.refresh();
23+
}
24+
</script>
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1+
<div style="display: flex">
2+
<label style="padding: 10px 10px 26px 0">Change the clip mode: </label>
3+
<span style="height:fit-content">
4+
<ejs-dropdownlist id="dropdown" dataSource="@ViewBag.dropdownData" change="Change"></ejs-dropdownlist>
5+
</span>
6+
</div>
7+
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource">
8+
<e-grid-columns>
9+
<e-grid-column field="NumberOfPatentFamilies" headerText="Number of Patent families" textAlign="Right" width="120"></e-grid-column>
110

11+
<e-grid-column field="Inventor" headerText="Inventor Name" textAlign="Right" width="120"></e-grid-column>
12+
<e-grid-column field="NumberOfINPADOCPatents" headerText="NumberOfINPADOCPatents" width="150"></e-grid-column>
13+
<e-grid-column field="MainFieldsOfInvention" headerText="Main Fields Of Invention" width="150"></e-grid-column>
14+
<e-grid-column field="Active" headerText="Active" textAlign="Right" width="150"></e-grid-column>
15+
</e-grid-columns>
16+
</ejs-grid>
217

3-
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" height="315" allowPaging="true">
4-
<e-grid-columns>
5-
<e-grid-column field="RoolNo" headerText="Rool No" textAlign="Right" width="100"></e-grid-column>
6-
<e-grid-column field="Name" headerText="Name of the inventor" clipMode="Clip" width="80"></e-grid-column>
7-
<e-grid-column field="patentfamilies" headerText="No of patentfamilies" clipMode="Ellipsis" width="100"></e-grid-column>
8-
<e-grid-column field="Country" headerText="Country" width="100"></e-grid-column>
9-
<e-grid-column field="mainfields" headerText="Main fields of Invention" clipMode="EllipsisWithTooltip" width="100"></e-grid-column>
10-
</e-grid-columns>
11-
</ejs-grid>
18+
19+
<script type="text/javascript">
20+
function Change(args) {
21+
var grid = document.getElementById("Grid").ej2_instances[0];
22+
grid.getColumnByField('MainFieldsOfInvention').clipMode = args.value;
23+
grid.refresh();
24+
}
25+
</script>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@Html.EJS().Tooltip("Tooltip").Target(".e-rowcell").ContentTemplate(@<div>
2+
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Columns(col =>
3+
{
4+
col.Field("OrderID").HeaderText("Order ID").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
5+
col.Field("CustomerID").HeaderText("Customer Name").Width("130").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
6+
col.Field("OrderDate").HeaderText("Order Date").Width("130").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Format("yMd").Add();
7+
col.Field("Freight").HeaderText("Freight").Width("120").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
8+
col.Field("ShipCountry").HeaderText("Ship Country").Width("120").Add();
9+
10+
}).Render()
11+
</div>).BeforeRender("beforeRender").Render()
12+
13+
<script>
14+
function beforeRender(args) {
15+
var tooltip = document.getElementById("Tooltip").ej2_instances[0]
16+
if (args.target.classList.contains('e-rowcell')) {
17+
// event triggered before render the tooltip on target element.
18+
tooltip.content = 'The value is "' + args.target.innerText + '" ';
19+
}
20+
}
21+
</script>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<ejs-tooltip id="Tooltip" target=".e-rowcell" beforeRender="beforeRender">
2+
<!-- Target element -->
3+
<e-content-template>
4+
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource">
5+
<e-grid-columns>
6+
<e-grid-column field="OrderID" headerText="Order ID" textAlign="Right" width="100"></e-grid-column>
7+
<e-grid-column field="CustomerID" headerText="Customer Name" width="120"></e-grid-column>
8+
<e-grid-column field="CustomerID" headerText="Customer ID" width="120"></e-grid-column>
9+
<e-grid-column field="OrderDate" headerText="Order Date" width="100" textAlign="Right" format="yMd"></e-grid-column>
10+
<e-grid-column field="Freight" headerText="Freight" width="100"></e-grid-column>
11+
<e-grid-column field="ShipCountry" headerText="Ship Country" textAlign="Right"
12+
width="100"></e-grid-column>
13+
</e-grid-columns>
14+
</ejs-grid>
15+
</e-content-template>
16+
</ejs-tooltip>
17+
18+
19+
<script>
20+
function beforeRender(args) {
21+
var tooltip = document.getElementById("Tooltip").ej2_instances[0];
22+
if (args.target.classList.contains('e-rowcell')) {
23+
// event triggered before render the tooltip on target element.
24+
tooltip.content = 'The value is "' + args.target.innerText + '" ';
25+
}
26+
}
27+
</script>

ej2-asp-core-mvc/code-snippet/grid/cell/customAttribute/razor

Lines changed: 0 additions & 16 deletions
This file was deleted.

ej2-asp-core-mvc/code-snippet/grid/cell/customAttribute/tagHelper

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
2+
{
3+
col.Field("OrderID").HeaderText("Order ID").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
4+
col.Field("CustomerID").HeaderText("Customer ID").Width("150").Add();
5+
col.Field("OrderDate").HeaderText("Order Date").Width("130").Format("yMd").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
6+
col.Field("Freight").HeaderText("Freight").Width("120").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
7+
col.Field("ShipCountry").HeaderText("Ship Country").Width("150").Add();
8+
9+
}).EnableHover(false).AllowSelection(false).QueryCellInfo("customizeCell").Render()
10+
11+
@section Scripts {
12+
<style>
13+
.below-30 {
14+
background-color: orangered;
15+
}
16+
.below-80 {
17+
background-color: yellow;
18+
}
19+
.above-80 {
20+
background-color: greenyellow;
21+
}
22+
</style>
23+
<script type="text/javascript">
24+
function customizeCell(args) {
25+
console.log(args.column);
26+
if (args.column.field === 'Freight') {
27+
var freightData = args.data['Freight'];
28+
if (freightData <= 30) {
29+
args.cell.classList.add('below-30');
30+
} else if (freightData > 30 && freightData < 80) {
31+
args.cell.classList.add('below-80');
32+
} else {
33+
args.cell.classList.add('above-80');
34+
}
35+
}
36+
}</script>
37+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" queryCellInfo="customizeCell">
2+
<e-grid-columns>
3+
<e-grid-column field="OrderID" headerText="Order ID" textAlign="Right" width="100"></e-grid-column>
4+
<e-grid-column field="CustomerID" headerText="Customer ID" width="120"></e-grid-column>
5+
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width="100"></e-grid-column>
6+
<e-grid-column field="ShipCountry" headerText="Ship Country" width="100"></e-grid-column>
7+
</e-grid-columns>
8+
</ejs-grid>
9+
10+
@section Scripts {
11+
<style>
12+
.below-30 {
13+
background-color: orangered;
14+
}
15+
16+
.below-80 {
17+
background-color: yellow;
18+
}
19+
20+
.above-80 {
21+
background-color: greenyellow;
22+
}
23+
</style>
24+
<script type="text/javascript">
25+
function customizeCell(args) {
26+
console.log(args.column);
27+
if (args.column.field === 'Freight') {
28+
var freightData = args.data['Freight'];
29+
if (freightData <= 30) {
30+
args.cell.classList.add('below-30');
31+
} else if (freightData > 30 && freightData < 80) {
32+
args.cell.classList.add('below-80');
33+
} else {
34+
args.cell.classList.add('above-80');
35+
}
36+
}
37+
}</script>
38+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
2+
{
3+
col.Field("OrderID").HeaderText("Order ID").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
4+
col.Field("CustomerID").HeaderText("Customer ID").Width("150").Add();
5+
col.Field("OrderDate").HeaderText("Order Date").Width("130").Format("yMd").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
6+
col.Field("Freight").HeaderText("Freight").Width("120").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
7+
col.Field("ShipCountry").HeaderText("Ship Country").Width("150").Add();
8+
}).SelectionSettings(select => select.Mode(Syncfusion.EJ2.Grids.SelectionMode.Cell).Type(Syncfusion.EJ2.Grids.SelectionType.Multiple)).Render()
9+
10+
@section Scripts {
11+
<style>
12+
.e-grid td.e-cellselectionbackground {
13+
background: #9ac5ee;
14+
font-style: italic;
15+
}
16+
</style>
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource">
2+
<e-grid-selectionsettings mode=Cell type="Multiple"></e-grid-selectionsettings>
3+
<e-grid-columns>
4+
<e-grid-column field="OrderID" headerText="Order ID" textAlign="Right" width="100"></e-grid-column>
5+
<e-grid-column field="CustomerID" headerText="Customer ID" width="120"></e-grid-column>
6+
<e-grid-column field="OrderDate" headerText="Order Date" format='yMd' width="100"></e-grid-column>
7+
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width="100"></e-grid-column>
8+
<e-grid-column field="ShipCountry" headerText="Ship Country" width="100"></e-grid-column>
9+
</e-grid-columns>
10+
</ejs-grid>
11+
12+
@section Scripts {
13+
<style>
14+
.e-grid td.e-cellselectionbackground {
15+
background: #9ac5ee;
16+
font-style: italic;
17+
}
18+
</style>
19+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public IActionResult Index()
2+
{
3+
var Order = OrderDetails.GetAllRecords();
4+
ViewBag.DataSource = Order;
5+
return View();
6+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
3+
{
4+
col.Field("OrderID").HeaderText("Order ID").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).CustomAttributes(new { @class = "custom-css" }).Add();
5+
col.Field("CustomerID").HeaderText("Customer ID").Width("150").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
6+
col.Field("ShipCity").HeaderText("Ship City").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).CustomAttributes(new { @class = "custom-css" }).Add();
7+
col.Field("ShipCountry").HeaderText("Ship Country").Width("150").Add();
8+
}).Render()
9+
10+
@section Scripts
11+
{
12+
<style>
13+
.custom-css{
14+
background: #d7f0f4;
15+
font-style: italic;
16+
color: navy
17+
}
18+
</ style >
19+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource">
2+
<e-grid-columns>
3+
<e-grid-column field="OrderID" headerText="Order ID" textAlign="Right" customAttributes=@(new {
4+
@class="custom-css" } ) width="100"></e-grid-column>
5+
<e-grid-column field="CustomerID" headerText="Customer ID" width="120"></e-grid-column>
6+
<e-grid-column field="ShipCity" headerText="Ship City" width="100" CustomAttributes=@(new{@class="custom-css"
7+
})></e-grid-column>
8+
<e-grid-column field="ShipCountry" headerText="Ship Country" textAlign="Right" width="100"></e-grid-column>
9+
</e-grid-columns>
10+
</ejs-grid>
11+
12+
@section Scripts {
13+
<style>
14+
.custom-css {
15+
background: #d7f0f4;
16+
font-style: italic;
17+
color: navy
18+
}
19+
</style>
20+
}

0 commit comments

Comments
 (0)