@Html.EJS().Grid("Grid").DataSource(ds => { ds.Url(Url.Action("UrlDataSource", "Home", "null", Request.Url.Scheme)).Adaptor("UrlAdaptor"); }).AllowFiltering(true).AllowMultiSorting(true).AllowSorting(true).AllowPaging(true).Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").CustomAttributes(new { @class = "customcss" }).Width("100").Add();
}).SearchSettings(s => { s.IgnoreCase(true); }).Toolbar(new List<string>(){ "Search" }).Render()
<style>
.customcss {
font-size: 25px !important;
}
</style> |
Hi Juan,
Thanks for contacting Syncfusion support.
Query #1: but in the search the exception is thrown
We have prepared the Grid sample with search option. But the reported issue was not reproduced at our end. So we have attached that sample with this update for your reference. Still, If you facing the same issue, please share the following details for further assistance,
- Network tab response while perform the search action.
- In which line you have faced this issue in controller.
- Share the screenshot of this issue.
- If possible try to reproduce this issue in our sample and send back to us.
- Syncfusion package version.
Query #2: is it possible to change the size of the grid letter?
We suggest to add the custom class to the Grid columns. After that you can add the custom style to that column cells by using that custom class. You can easily add this custom class to the Grid column by using CustomAttributes property of the Grid. Please refer the following code snippet,
@Html.EJS().Grid("Grid").DataSource(ds => { ds.Url(Url.Action("UrlDataSource", "Home", "null", Request.Url.Scheme)).Adaptor("UrlAdaptor"); }).AllowFiltering(true).AllowMultiSorting(true).AllowSorting(true).AllowPaging(true).Columns(col =>{col.Field("OrderID").HeaderText("Order ID").CustomAttributes(new { @class = "customcss" }).Width("100").Add();}).SearchSettings(s => { s.IgnoreCase(true); }).Toolbar(new List<string>(){ "Search" }).Render()<style>.customcss {font-size: 25px !important;}</style>
Please refer the below sample for your both queries,
Documentation for customAttributes property: https://ej2.syncfusion.com/aspnetmvc/documentation/grid/cell/#custom-attributes
Regards,Hariharan
|
|