We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dialog/Inline template

I'm working with a grid that I setup an inline dialog template for.  What I'm trying to work out is how to set validation rules on the components within the template.  I'm currently using EjsDropDownList and EjsTextBox element.  I've tried setting @ref to them and then adding attributes in events, but the references are always null in the events so it fails.  I've searched around and can't find an example of anyone performing validation on the controls within an edit template.

3 Replies

RS Renjith Singh Rajendran Syncfusion Team December 16, 2019 01:22 PM UTC

Hi Jonathan, 

Thanks for contacting Syncfusion support. 

We suggest you to set the “ValidationRules” property for Grid column. Please refer the below documentation link for more details regarding column validation.  
 
We have prepared a sample based on this, please download the sample from the link below, 
 
 
    <GridColumns> 
        ... 
       <GridColumn Field=@nameof(OrdersDetails.ShipAddress) HeaderText="Ship Country"  ValidationRules="@(new { required=true})" Width="150"></GridColumn> 
    </GridColumns> 
 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 



JN Jonathan Nordell December 16, 2019 04:20 PM UTC

I found my issue.  The column is hidden in the grid, but shown in my template.  I see in the JS version of the grid there's a way to change the defaults of the validator.  Is this possible in the Blazor version?


RS Renjith Singh Rajendran Syncfusion Team December 17, 2019 12:07 PM UTC

Hi Jonathan, 

We have analyzed your query, it is not possible to perform validation as like in JavaScript for a column which are not defined. You must have to define the column to perform validation for that particular column in Blazor Grid. So, based on your requirement, as a workaround we suggest you to set the “Width” property as 0, for the Grid Columns you wish to hide in Grid. So that these columns will be hidden in Grid and will be displayed only for editing along with the ValidationRules. Please use the code below, 

 
<GridColumn Field=@nameof(OrdersDetails.ShipAddress) ValidationRules="@(new { required=true})" Width="0"></GridColumn> 


We have modified the sample from our previous update. Please download the sample from the link below, 
 
And also we would like to inform you that Grid supports DataAnnotation also. Please refer the documentation link for more details, 

Query : I see in the JS version of the grid there's a way to change the defaults of the validator. 
We suspect that you are referring to the “Custom Validation”(https://ej2.syncfusion.com/javascript/documentation/grid/edit/?no-cache=1#custom-validation) feature of JS Grid. If so, currently we do not have support for Custom Validation in Blazor Grid. We have logged this as a feature task and added to our feature request list. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.  
 
We have considered this requirement for our 2019 Volume 4 Service pack 1 release which is expected to rolled out in the month of January 2020.  
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.   
 
Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Live Chat Icon For mobile
Up arrow icon