Skip to content

Ej2-858875 - Added the topic for Hide the dates in datepicker, Retrie… #3785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: hotfix/hotfix-v28.1.33
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public IActionResult Index()
{
ViewBag.DataSource = OrdersDetails.GetAllRecords();
return View();
}


20 changes: 20 additions & 0 deletions ej2-asp-core-mvc/code-snippet/grid/edit/hide-date/razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("100").ValidationRules(new { required = "true", number = true }).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("CustomerID").HeaderText("Customer ID").ValidationRules(new { required = "true" }).Width("120").Add();
col.Field("Freight").HeaderText("Freight").EditType("numericedit").ValidationRules(new { required = "true", min = 1, max = 1000 }).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("120").Add();
col.Field("ShipCity").HeaderText("Ship City").ValidationRules(new { required = "true" }).EditType("dropdownedit").Width("150").Add();
col.Field("OrderDate").HeaderText("Order Date").ValidationRules(new { required = true }).Width("150").EditType("datepickeredit").Format("MM-dd-yyy").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
}).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Normal); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).ActionBegin("actionBegin").Render()
<script>
function actionBegin(args) {
if (args.requestType === 'beginEdit') {
let minDate = args.rowData['OrderDate'];
this.columns.forEach((column) => {
if (column.field === 'OrderDate') {
column.edit.params = { min: minDate };
}
});
}
}
</script>
22 changes: 22 additions & 0 deletions ej2-asp-core-mvc/code-snippet/grid/edit/hide-date/tagHelper
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" actionBegin="actionBegin">
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" validationRules="@(new { required=true, number=true})" textAlign="Right" width="100"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer ID" validationRules="@(new { required=true})" width="120"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" editType="numericedit" validationRules="@(new { required= true,min=1, max=1000 })" textAlign="Right" width="120"></e-grid-column>
<e-grid-column field="ShipCity" headerText="Ship City" validationRules="@(new { required=true})" editType="dropdownedit" width="150"></e-grid-column>
<e-grid-column field="OrderDate" headerText="Order Date" format="MM-dd-yyyy" editType="datepickeredit" width="150"></e-grid-column>
</e-grid-columns>
</ejs-grid>
<script>
function actionBegin(args) {
if (args.requestType === 'beginEdit') {
let minDate = args.rowData['OrderDate'];
this.columns.forEach((column) => {
if (column.field === 'OrderDate') {
column.edit.params = { min: minDate };
}
});
}
}
</script>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: Group and Caption Aggregate in ##Platform_Name## Grid Component
title: Group and Caption Aggregate in Syncfusion ##Platform_Name## Grid Component
description: Learn here all about Group and Caption Aggregate in Syncfusion ##Platform_Name## Grid component of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Group and Caption Aggregate
Expand Down Expand Up @@ -68,4 +68,4 @@ In some cases, you may want to disable the page-wise aggregates for grouping in
{% endhighlight %}
{% endtabs %}

![Disable page wise aggregates for grouping](../images/aggregates/group-disable-page.gif)
![Disable page wise aggregates for grouping](../images/aggregates/group-disable-page.gif)
27 changes: 22 additions & 5 deletions ej2-asp-core-mvc/grid/EJ2_ASP.MVC/editing/edit-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ The following sample demonstrates how to open the popup when focusing on the edi
{% endhighlight %}
{% endtabs %}

![Customize dropdown edit type](../images/editing/dropdown-popup.gif)
![Customize dropdown edit type](../images/editing/dropdown-popup.png)

## Customize CheckBox component of booleanedit type

Expand Down Expand Up @@ -225,6 +225,23 @@ The following sample code demonstrates the customization applied to DatePicker c

![Customize date picker edit type](../images/editing/datepicker-edit-type.png)

### Disable the date value prior to the selected date value in DatePicker control

The Syncfusion Grid allows configuring the [DatePicker](../../datepicker) control to dynamically set a minimum date for selection. This feature ensures that users can select dates only from a specified minimum date onward, based on the context of each row's data. This functionality is particularly useful in maintaining data accuracy by preventing users from selecting invalid or illogical dates.

The following example demonstrates how to configure the `DatePicker` control within the grid using the **edit** parameters of a column. This setup dynamically restricts the selection of dates in the DatePicker's calendar based on the data in the current row.

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/grid/edit/hide-date/razor %}
{% endhighlight %}
{% highlight c# tabtitle="hide-date.cs" %}
{% include code-snippet/grid/edit/hide-date/hide-date.cs %}
{% endhighlight %}
{% endtabs %}

![Disable the date value](../images/editing/hide-date.png)

## Customize DateTimePicker component of datetimepickeredit type

You can customize the DateTimePicker component in Grid edit form using its property. This customization allows you to configure various properties of the DateTimePicker, tailoring its behavior and appearance to match your specific requirements within the Grid. The behavior of the editor component can be fine-tuned through the `Columns->Edit->Params` property.
Expand Down Expand Up @@ -376,7 +393,7 @@ The following example demonstrates how to render images in the DropDownList edit
{% endhighlight %}
{% endtabs %}

![Render drop down list component with image](../images/editing/dropdown-with-image.png)
![Render drop down list component with image](../images/editing/dropdown-with-image.jpeg)

### Render Multiple columns in DropDownList component

Expand Down Expand Up @@ -454,7 +471,7 @@ The following example demonstrates how to render a MultiSelect component in the
{% endhighlight %}
{% endtabs %}

![Render multiselect component](../images/editing/render-multiselect-dropdown.gif)
![Render multiselect component](../images/editing/render-multiselect-dropdown.jpeg)

### Render RichTextEditor component in edit form

Expand All @@ -475,7 +492,7 @@ The following example demonstrates how to render a RichTextEditor component in t
{% endhighlight %}
{% endtabs %}

![Render richtext editor component](../images/editing/render-richtext-editor.gif)
![Render richtext editor component](../images/editing/render-richtext-editor.jpeg)

### Render Upload component in edit form

Expand All @@ -494,7 +511,7 @@ The following example demonstrates how to render a Upload control in the **Emplo
{% endhighlight %}
{% endtabs %}

![Render Upload component in edit form](../images/editing/edit-types-upload.gif)
![Render Upload component in edit form](../images/editing/edit-types-upload.jpeg)

### Render AutoComplete component in edit form

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: Group and Caption Aggregate in ##Platform_Name## Grid Component
title: Group and Caption Aggregate in Syncfusion ##Platform_Name## Grid Component
description: Learn here all about Group and Caption Aggregate in Syncfusion ##Platform_Name## Grid component of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Group and Caption Aggregate
Expand Down
27 changes: 22 additions & 5 deletions ej2-asp-core-mvc/grid/EJ2_ASP.NETCORE/editing/edit-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ The following sample demonstrates how to open the popup when focusing on the edi
{% endhighlight %}
{% endtabs %}

![Customize dropdown edit type](../images/editing/dropdown-popup.gif)
![Customize dropdown edit type](../images/editing/dropdown-popup.png)

## Customize CheckBox component of booleanedit type

Expand Down Expand Up @@ -225,6 +225,23 @@ The following sample code demonstrates the customization applied to DatePicker c

![Customize date picker edit type](../images/editing/datepicker-edit-type.png)

### Disable the date value prior to the selected date value in DatePicker control

The Syncfusion Grid allows configuring the [DatePicker](../../datepicker) control to dynamically set a minimum date for selection. This feature ensures that users can select dates only from a specified minimum date onward, based on the context of each row's data. This functionality is particularly useful in maintaining data accuracy by preventing users from selecting invalid or illogical dates.

The following example demonstrates how to configure the `DatePicker` control within the grid using the **edit** parameters of a column. This setup dynamically restricts the selection of dates in the DatePicker's calendar based on the data in the current row.

{% tabs %}
{% highlight cshtml tabtitle="CSHTML" %}
{% include code-snippet/grid/edit/hide-date/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="hide-date.cs" %}
{% include code-snippet/grid/edit/hide-date/hide-date.cs %}
{% endhighlight %}
{% endtabs %}

![Disable the date value](../images/editing/hide-date.png)

## Customize DateTimePicker component of datetimepickeredit type

You can customize the DateTimePicker component in Grid edit form using its property. This customization allows you to configure various properties of the DateTimePicker, tailoring its behavior and appearance to match your specific requirements within the Grid. The behavior of the editor component can be fine-tuned through the `columns->edit->params` property.
Expand Down Expand Up @@ -376,7 +393,7 @@ The following example demonstrates how to render images in the DropDownList edit
{% endhighlight %}
{% endtabs %}

![Render drop down list component with image](../images/editing/dropdown-with-image.png)
![Render drop down list component with image](../images/editing/dropdown-with-image.jpeg)

### Render Multiple columns in DropDownList component

Expand Down Expand Up @@ -454,7 +471,7 @@ The following example demonstrates how to render a MultiSelect component in the
{% endhighlight %}
{% endtabs %}

![Render multiselect component](../images/editing/render-multiselect-dropdown.gif)
![Render multiselect component](../images/editing/render-multiselect-dropdown.jpeg)

### Render RichTextEditor component in edit form

Expand All @@ -475,7 +492,7 @@ The following example demonstrates how to render a RichTextEditor component in t
{% endhighlight %}
{% endtabs %}

![Render richtext editor component](../images/editing/render-richtext-editor.gif)
![Render richtext editor component](../images/editing/render-richtext-editor.jpeg)

### Render Upload component in edit form

Expand All @@ -494,7 +511,7 @@ The following example demonstrates how to render a Upload control in the **Emplo
{% endhighlight %}
{% endtabs %}

![Render Upload component in edit form](../images/editing/edit-types-upload.gif)
![Render Upload component in edit form](../images/editing/edit-types-upload.jpeg)

### Render AutoComplete component in edit form

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.