- Home
- Forum
- ASP.NET Core - EJ 2
- Grid Validation Hidden with only one row
Grid Validation Hidden with only one row
When adding the first row, or editing with only one row (works fine if there are two or more rows) to a grid the validation is hidden under the footer requiring the user has to scroll to see the messages. This can be confusion, especially to a new user. What would be the best way to expand the grid to see the messages should they appear?
This is what the user sees:
They need to scroll to see the messages:
SIGN IN To post a reply.
3 Replies
MS
Madhu Sudhanan P
Syncfusion Team
March 13, 2019 05:14 AM UTC
Hi Michael,
Greeting from Syncfusion.
Query: What would be the best way to expand the grid to see the messages should they appear?
By default, we have applied height as auto for the Grid so that it display vertical scrollbar while perform adding and editing with single data in Grid. If you don’t want scrollbar then we suggest you to use the below way to achieve your requirement.
In the below code example, we have checked grid dataSource and based on that we applied height for the Grid. Please refer the below code example for more information.
|
<div id="ControlRegion">
<ejs-grid id="Grid" dataBound="dataBound" toolbar="@(new List<string>() { "Add","Edit", "Update", "Cancel" })" allowPaging="true">
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Normal"></e-grid-editSettings>
<e-grid-pagesettings pageCount="5"></e-grid-pagesettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" validationRules="@(new { required=true})" textAlign="Right" width="120"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer Name" validationRules="@(new { required=true})"></e-grid-column>
. . . .
</e-grid-columns>
</ejs-grid>
</div>
<script>
function dataBound() {
this.height = (this.dataSource.length <= 1) ? "80px" : "auto";
}
</script> |
|
|
Regards,
Madhu Sudhanan P
ML
Michael Lambert
March 13, 2019 10:59 PM UTC
Worked, Thanks!
MS
Madhu Sudhanan P
Syncfusion Team
March 14, 2019 03:40 AM UTC
Hi Michael,
Thanks for the update.
Regards,
Madhu
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
ML Michael Lambert
- Mar 12, 2019 05:53 PM UTC
- Mar 14, 2019 03:40 AM UTC