Skip to content

Commit 01aec15

Browse files
committed
Sync with Kendo UI Professional
1 parent e61c097 commit 01aec15

File tree

16 files changed

+792
-46
lines changed

16 files changed

+792
-46
lines changed

docs-aspnet/globalization/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ To use a culture that is different from the default `en-US` one in {{ site.produ
7373
kendo.culture("es-ES");
7474
</script>
7575

76+
>tip You can find the complete list of available cultures in the [Kendo UI Core repository](https://github.com/telerik/kendo-ui-core/tree/master/src/cultures).
77+
7678
## Matching Cultures
7779

7880
The cultures that are set on the client and on the server have to match. This ensures that dates and numbers are displayed and parsed correctly.

docs-aspnet/html-helpers/data-management/grid/binding/overview.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ Check the `Skeleton` loading type in action in the live demo below:
4848

4949
* [Skeleton Loading Type Demo](https://demos.telerik.com/{{ site.platform }}/skeletoncontainer/grid-integration)
5050

51+
## KB Articles on Grid Data Binding
52+
53+
{% if site.core %}
54+
* [Troubleshooting the Grid When Data Doesn't Load](/knowledge-base/grid-is-not-showing-data)
55+
* [Grid Dynamic Data Binding](/knowledge-base/grid-dynamic)
56+
{% endif %}
57+
* [Find Out More in the Knowledge Base](/knowledge-base)
58+
5159
## See Also
5260

5361
* [Remote Ajax Binding by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/remote-data-binding)

docs-aspnet/html-helpers/data-management/grid/editing/inline.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@ For runnable examples, refer to the [demos on implementing the editing approache
2424

2525
1. Pick the **Generate from database** option and click **Next**. Configure a connection to the Northwind database. Click **Next**.
2626

27-
![{{ site.product_short }} Choosing the connection](../images/grid-entity-data-model.png)
27+
![{{ site.product_short }} Choosing the connection](../images/grid-binding-choose-data-connection.png)
2828

2929
1. Choose the **Products** table from the **Which database objects do you want to include in your model?**. Leave all other options as they are set by default. Click **Finish**.
3030

31-
![{{ site.product_short }} Choosing the Products table in the database objects](../images/grid-database-objects.png)
31+
![{{ site.product_short }} Choosing the Products table in the database objects](../images/grid-binding-choose-database-objects.png)
3232
{% else %}
3333

3434
1. Add a new class to the `~/Models` folder. The following example uses the `ProductViewModel` name.
3535

3636
public class ProductViewModel
37-
3837
{
3938
public int ProductID { get; set; }
4039
// The ProductName property is required.
@@ -61,6 +60,7 @@ For runnable examples, refer to the [demos on implementing the editing approache
6160

6261
1. Add a new action method to `HomeController.cs`. It will be responsible for saving the new data items. Name the method `Products_Create`.
6362

63+
{% if site.core %}
6464
public ActionResult Products_Create([DataSourceRequest]DataSourceRequest request, ProductViewModel product)
6565
{
6666
if (ModelState.IsValid)
@@ -84,6 +84,45 @@ For runnable examples, refer to the [demos on implementing the editing approache
8484
// Return the inserted product. The Grid needs the generated ProductID. Also return any validation errors.
8585
return Json(new[] { product }.ToDataSourceResult(request, ModelState));
8686
}
87+
{% else %}
88+
```Controller
89+
public ActionResult Products_Create([DataSourceRequest]DataSourceRequest request, ProductViewModel product)
90+
{
91+
if (ModelState.IsValid)
92+
{
93+
using (var northwind = new NorthwindEntities())
94+
{
95+
// Create a new Product entity and set its properties from the posted ProductViewModel.
96+
var entity = new Product
97+
{
98+
ProductName = product.ProductName,
99+
UnitsInStock = product.UnitsInStock
100+
};
101+
// Add the entity.
102+
northwind.Products.Add(entity);
103+
// Insert the entity in the database.
104+
northwind.SaveChanges();
105+
// Get the ProductID generated by the database.
106+
product.ProductID = entity.ProductID;
107+
}
108+
}
109+
// Return the inserted product. The Grid needs the generated ProductID. Also return any validation errors.
110+
return Json(new[] { product }.ToDataSourceResult(request, ModelState));
111+
}
112+
```
113+
```ViewModel
114+
public class ProductViewModel
115+
{
116+
public int ProductID { get; set; }
117+
// The ProductName property is required.
118+
[Required]
119+
public string ProductName { get; set; }
120+
// Use the Integer editor template for the UnitsInStock property.
121+
[UIHint("Integer")]
122+
public short? UnitsInStock { get; set; }
123+
}
124+
```
125+
{% endif %}
87126
88127
1. Add a new action method to `HomeController.cs`. It will be responsible for saving the updated data items. Name the method `Products_Update`.
89128

0 commit comments

Comments
 (0)