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

Grid custom validation rules for Blazor

Thread ID:

Created:

Updated:

Platform:

Replies:

149715 Dec 6,2019 11:13 AM UTC Dec 12,2019 11:05 AM UTC Blazor 3
loading
Tags: Grid
Puriphat Sinanalert
Asked On December 6, 2019 11:13 AM UTC

Hello, Syncfusion

I try to use validation rules with variable to validate minimum value in Grid column like this,

<GridColumn Field=@nameof(JobTask.Cost) HeaderText="Cost" TextAlign="TextAlign.Center" Format="N2" Width="10%" ValidationRules="@(new { required = true, min =  ValidateValue })"></GridColumn>

but it's not work, what should I do?

Thanks,
Puriphat S.

Vignesh Natarajan [Syncfusion]
Replied On December 9, 2019 09:08 AM UTC

Hi Puriphat,  

Greetings from Syncfusion support.  

Query: “I try to use validation rules with variable to validate minimum value in Grid column like this, but it's not work, what should I do? 
 
We tried to replicate the reported issue by preparing a sample with Edit operation to validate the number column with minimum value. We have defined the ValidationRules property to GridColumn like below and we are not able to reproduce the reported issue at our end. While editing / adding , validation rules is displayed when saving with value less than 95.  

<EjsGrid DataSource="@Orders" Height="315" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })"> 
. . . . . . . . . .  
        <GridColumn Field=@nameof(Order.Freight) HeaderText="Cost" TextAlign="TextAlign.Center" Format="N2" Width="10%" ValidationRules="@(new { required = true, min =  ValidateValue })"></GridColumn> 
    </GridColumns> 
</EjsGrid> 
 
@code{ 
    public List<Order> Orders { get; set; } 
    public int ValidateValue = 95; 
. . . . . . . ..   
} 

Refer the below screenshot for the output  

 

Kindly download the sample from below  


If you are still facing the issue, kindly get back to us with following details.  

  1. Share your Grid rendering code example.
  2. Are you facing any script error while editing a record? . If yes, share the screenshot of the issue.
  3. Share your Syncfusion Nuget package version details.
  4. If possible try to reproduce the reported issue in provided sample.

Requested details will be helpful for us to validate the reported issue at our end and provide solution as soon as possible. 

Regards, 
Vignesh Natarajan. 


Puriphat Sinanalert
Replied On December 11, 2019 09:38 AM UTC

Thank you for your answer!

But to be more clear, I need to compare and validate between cost and actual cost column by the cost must be greater than actual cost and validate while editing.

Here's the screenshot of example.

https://ibb.co/pwFJjr4


Thanks,

Puriphat Sinananlert.


Vignesh Natarajan [Syncfusion]
Replied On December 12, 2019 11:05 AM UTC

Hi Puriphat, 

Query: “ need to compare and validate between cost and actual cost column by the cost must be greater than actual cost and validate while editing. 

We can achieve your requirement using Custom validation feature. But currently we do not have support for custom validation for 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.  
 
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. 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.   
 

Till then we appreciate your patience.  

Regards, 
Vignesh Natarajan. 
 


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