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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dialog/Inline template

Thread ID:

Created:

Updated:

Platform:

Replies:

149885 Dec 13,2019 12:22 AM UTC Dec 17,2019 12:07 PM UTC Blazor 3
loading
Tags: Grid
Jonathan Nordell
Asked On December 13, 2019 12:22 AM UTC

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.

Renjith Singh Rajendran [Syncfusion]
Replied On 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. 


Jonathan Nordell
Replied On 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?

Renjith Singh Rajendran [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon