Skip to content

Commit b853223

Browse files
384809: Added the changes based on provided comments
1 parent beb4886 commit b853223

File tree

11 files changed

+26
-24
lines changed

11 files changed

+26
-24
lines changed

ej2-asp-core-mvc/code-snippet/grid/columns/frozen-datepicker/razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).FrozenColumns(2).Columns(col =>
22
{
3-
col.Field("OrderID").HeaderText("Order ID").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
3+
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
44
col.Field("OrderDate").HeaderText("Order Date").Width("130").Format("yMd").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Edit(new { create = "createDatePicker", read = "readDatePicker", destroy = "destroyDatePicker", write = "writeDatePicker" }).Add();
55
col.Field("CustomerID").HeaderText("Customer ID").Width("130").Add();
66
col.Field("ShipCity").HeaderText("Ship City").Width("120").Add();

ej2-asp-core-mvc/code-snippet/grid/data-binding/custom-headers/razor

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
@Html.EJS().Grid("CustomAdaptor").Columns(col =>
22
{
3+
col.Field("OrderID").HeaderText("Order ID").Width("100").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
34
col.Field("CustomerID").HeaderText("Customer ID").Width("160").Add();
5+
col.Field("EmployeeID").HeaderText("Employee ID").Width("100").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
46
col.Field("Freight").HeaderText("Freight").Width("150").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
5-
col.Field("ShipCity").HeaderText("Ship City").Width("150").Add();
67
col.Field("ShipCountry").HeaderText("Ship Country").Width("150").Add();
78

8-
}).Created("created").Render()
9+
}).AllowPaging().Created("created").Render()
910

1011
<script>
1112
function created(args) {
1213
class CustomAdaptor extends ej.data.WebApiAdaptor {
1314
beforeSend(args, xhr, settings) {
1415
xhr.withCredentials = true;
1516
super.beforeSend(args, xhr, settings);
16-
xhr.headers.set('Syncfusion', true);
17+
xhr.headers.set('Syncfusion', true); // Assign custom headers here.
1718
}
1819
}
1920
var grid = document.querySelector('#CustomAdaptor').ej2_instances[0];

ej2-asp-core-mvc/code-snippet/grid/data-binding/custom-headers/tagHelper

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<ejs-grid id="CustomAdaptor" created="created">
1+
<ejs-grid id="CustomAdaptor" allowPaging="true" created="created">
22
<e-grid-columns>
3+
<e-grid-column field="OrderID" headerText="Order Name" width="150" textAlign="Right"></e-grid-column>
34
<e-grid-column field="CustomerID" headerText="Customer Name" width="150"></e-grid-column>
4-
<e-grid-column field="Freight" headerText="Freight" format="C2" width="120"></e-grid-column>
5-
<e-grid-column field="ShipCity" headerText="Ship City"></e-grid-column>
5+
<e-grid-column field="EmployeeID" headerText="Employee Name" width="150" textAlign="Right"></e-grid-column>
6+
<e-grid-column field="Freight" headerText="Freight" format="C2" width="120" textAlign="Right"></e-grid-column>
67
<e-grid-column field="ShipCountry" headerText="Ship Country" width="150"></e-grid-column>
78
</e-grid-columns>
89
</ejs-grid>
@@ -13,7 +14,7 @@
1314
beforeSend(args, xhr, settings) {
1415
xhr.withCredentials = true;
1516
super.beforeSend(args, xhr, settings);
16-
xhr.headers.set('Syncfusion', true);
17+
xhr.headers.set('Syncfusion', true); // Assign custom headers here.
1718
}
1819
}
1920
var grid = document.querySelector('#CustomAdaptor').ej2_instances[0];

ej2-asp-core-mvc/code-snippet/grid/excel-export/excelexport-format/tagHelper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<e-grid-column field="EmployeeID" headerText="Employee ID" textAlign="Right" width="125"></e-grid-column>
1515
<e-grid-column field="FirstName" headerText="First Name" width="120"></e-grid-column>
1616
<e-grid-column field="LastName" headerText="Last Name" width="170"></e-grid-column>
17-
<e-grid-column field="City" headerText="City" textAlign="Right" width="135"></e-grid-column>
17+
<e-grid-column field="City" headerText="City" width="135"></e-grid-column>
1818
</e-grid-columns>
1919
</ejs-grid>
2020
<script>

ej2-asp-core-mvc/code-snippet/grid/globalization/two-localization/razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add();
1010
col.Field("ShipName").HeaderText("Ship Name").Width("150").Add();
1111
col.Field("ShipCountry").HeaderText("Ship Country").Width("150").Add();
12-
}).AllowPaging().Locale("en").Render()
12+
}).AllowPaging().Render()
1313
<script>
1414
ej.base.L10n.load({
1515
'fr-FR': {

ej2-asp-core-mvc/code-snippet/grid/globalization/two-localization/tagHelper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</e-grid-columns>
88
</ejs-grid>
99

10-
<ejs-grid id="Grid2" dataSource="@ViewBag.datasource" allowPaging="true" locale="en" >
10+
<ejs-grid id="Grid2" dataSource="@ViewBag.datasource" allowPaging="true" >
1111
<e-grid-columns>
1212
<e-grid-column field="OrderID" headerText="Order ID" width="120" textAlign= "Right"></e-grid-column>
1313
<e-grid-column field="CustomerID" headerText="Customer Name" width="150"></e-grid-column>

ej2-asp-core-mvc/code-snippet/grid/state-persist/observable/razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<script>
1717
function created() {
1818
const grid = document.getElementById("grid").ej2_instances[0];
19-
const query = grid.getDataModule().generateQuery();
20-
const state = ej.grids.getStateEventArgument(query);
21-
dataStateChange(state);
19+
const query = grid.getDataModule().generateQuery(); // Generate the initial query state from the Grid's data module.
20+
const state = ej.grids.getStateEventArgument(query); // Retrieve the Grid's current state based on the generated query.
21+
dataStateChange(state); // Send the retrieved state to the service to fetch data accordingly.
2222
}
2323
function dataStateChange(state) {
2424
const grid = document.getElementById("grid").ej2_instances[0];

ej2-asp-core-mvc/grid/EJ2_ASP.MVC/excel-export/excel-exporting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ The following example demonstrates how to export hierarchical grid to Excel docu
234234

235235
The Syncfusion Grid allows customization of the child Grid's Excel export options, enabling precise control over data formatting before export. This functionality is achieved using the [ExportDetailDataBound](https://help.syncfusion.com/cr/aspnetMVC-js2/syncfusion.ej2.grids.grid.html#Syncfusion_EJ2_Grids_Grid_ExportDetailDataBound) event, which is triggered for each child Grid during the export process. This event provides access to the child Grid instance, allowing modifications to its column formatting before generating the Excel document.
236236

237-
In the following example, the `ExportDetailDataBound` event is used to modify the **OrderDate** column of the child Grid. By setting the column's [Format](https://help.syncfusion.com/cr/aspnetMVC-js2/Syncfusion.EJ2.Grids.GridColumn.html#Syncfusion_EJ2_Grids_GridColumn_Format) property, the date values are formatted as `dd/MM/yyyy` when exported to Excel.
237+
In the following example, the `ExportDetailDataBound` event is used to modify the **OrderDate** column of the child Grid. By setting the column's [Format](https://help.syncfusion.com/cr/aspnetMVC-js2/Syncfusion.EJ2.Grids.GridColumn.html#Syncfusion_EJ2_Grids_GridColumn_Format) property, the date values are formatted as `dd/MM/yyyy` when exported to Excel document.
238238

239239
{% tabs %}
240240
{% highlight razor tabtitle="CSHTML" %}

ej2-asp-core-mvc/grid/EJ2_ASP.MVC/global-local.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,13 @@ To switch to the **French** culture and set the currency code as **EUR**, you ca
295295

296296
![Globalization-Switch-Culture](images/globalization/switch-localization.gif)
297297

298-
### Set different locale for two Grids in same page
298+
### Set different Locale text for two Grids in same page
299299

300-
The Syncfusion Grid allows configuring different [locale](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.grids.grid.html#Syncfusion_EJ2_Grids_Grid_Locale) settings for multiple Grids displayed on the same page. By using the **load** function of the **L10n** class, you can customize the text content of the Grid to be displayed in different languages.
300+
The Syncfusion Grid allows configuring different [Locale](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.grids.grid.html#Syncfusion_EJ2_Grids_Grid_Locale) settings for multiple Grids displayed on the same page. By using the **load** function of the **L10n** class, you can customize the text content of the Grid to be displayed in different languages.
301301

302-
In this setup, each Grid can display text in a different language based on its assigned `locale`. The `load` function is used to define translations for specific languages, ensuring that each Grid correctly applies the localized text for headers, toolbar items, and action buttons.
302+
In this setup, each Grid can display text in a different language based on its assigned `Locale`. The `load` function is used to define translations for specific languages, ensuring that each Grid correctly applies the localized text for headers, toolbar items, and action buttons.
303303

304-
For example, when the first Grid is set to use the **fr-FR** locale, it applies the French translations loaded via **L10n.load**. The second Grid, set to **en-US**, retains the default English text. This demonstrates how localization can be customized per Grid without affecting other components on the page.
304+
For example, when the first Grid is set to use the **fr-FR** Locale, it applies the French translations loaded via **L10n.load**. The second Grid, set to **en-US**, retains the default English text. This demonstrates how localization can be customized per Grid without affecting other components on the page.
305305

306306
{% tabs %}
307307
{% highlight razor tabtitle="CSHTML" %}

ej2-asp-core-mvc/grid/EJ2_ASP.NETCORE/excel-export/excel-exporting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ The following example demonstrates how to export hierarchical grid to Excel docu
234234

235235
The Syncfusion Grid allows customization of the child Grid's Excel export options, enabling precise control over data formatting before export. This functionality is achieved using the [exportDetailDataBound](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.grids.grid.html#Syncfusion_EJ2_Grids_Grid_ExportDetailDataBound) event, which is triggered for each child Grid during the export process. This event provides access to the child Grid instance, allowing modifications to its column formatting before generating the Excel document.
236236

237-
In the following example, the `exportDetailDataBound` event is used to modify the **OrderDate** column of the child Grid. By setting the column's [format](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Grids.GridColumn.html#Syncfusion_EJ2_Grids_GridColumn_Format) property, the date values are formatted as `dd/MM/yyyy` when exported to Excel.
237+
In the following example, the `exportDetailDataBound` event is used to modify the **OrderDate** column of the child Grid. By setting the column's [format](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Grids.GridColumn.html#Syncfusion_EJ2_Grids_GridColumn_Format) property, the date values are formatted as `dd/MM/yyyy` when exported to Excel document.
238238

239239
{% tabs %}
240240
{% highlight cshtml tabtitle="CSHTML" %}

ej2-asp-core-mvc/grid/EJ2_ASP.NETCORE/global-local.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,13 @@ To switch to the **French** culture and set the currency code as **EUR**, you ca
295295

296296
![Globalization-Switch-Culture](images/globalization/switch-localization.gif)
297297

298-
### Set different locale for two Grids in same page
298+
### Set different Locale text for two Grids in same page
299299

300-
The Syncfusion Grid allows configuring different [locale](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.grids.grid.html#Syncfusion_EJ2_Grids_Grid_Locale) settings for multiple Grids displayed on the same page. By using the **load** function of the **L10n** class, you can customize the text content of the Grid to be displayed in different languages.
300+
The Syncfusion Grid allows configuring different [Locale](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.grids.grid.html#Syncfusion_EJ2_Grids_Grid_Locale) settings for multiple Grids displayed on the same page. By using the **load** function of the **L10n** class, you can customize the text content of the Grid to be displayed in different languages.
301301

302-
In this setup, each Grid can display text in a different language based on its assigned `locale`. The `load` function is used to define translations for specific languages, ensuring that each Grid correctly applies the localized text for headers, toolbar items, and action buttons.
302+
In this setup, each Grid can display text in a different language based on its assigned `Locale`. The `load` function is used to define translations for specific languages, ensuring that each Grid correctly applies the localized text for headers, toolbar items, and action buttons.
303303

304-
For example, when the first Grid is set to use the **fr-FR** locale, it applies the French translations loaded via **L10n.load**. The second Grid, set to **en-US**, retains the default English text. This demonstrates how localization can be customized per Grid without affecting other components on the page.
304+
For example, when the first Grid is set to use the **fr-FR** Locale, it applies the French translations loaded via **L10n.load**. The second Grid, set to **en-US**, retains the default English text. This demonstrates how localization can be customized per Grid without affecting other components on the page.
305305

306306
{% tabs %}
307307
{% highlight cshtml tabtitle="CSHTML" %}

0 commit comments

Comments
 (0)