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.
Unfortunately, activation email could not send to your email. Please try again.

Validation is not working on grid dropdown column

Thread ID:

Created:

Updated:

Platform:

Replies:

132355 Aug 28,2017 08:01 AM Aug 30,2017 12:12 PM ASP.NET MVC 3
loading
Tags: Grid
Than Htike Aung
Asked On August 28, 2017 08:01 AM

@(Html.EJ().Grid<object>("FlatGrid")
    .Datasource(ds => ds.URL("api/List").BatchURL("api/Update").Adaptor(AdaptorType.UrlAdaptor))
    .AllowPaging()
    .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch).ShowConfirmDialog(); })
    .ToolbarSettings(toolbar =>
    {
        toolbar.ShowToolbar().ToolbarItems(items =>
        {
            items.AddTool(ToolBarItems.Add);
            items.AddTool(ToolBarItems.Edit);
            items.AddTool(ToolBarItems.Delete);
            items.AddTool(ToolBarItems.Update);
            items.AddTool(ToolBarItems.Cancel);
        });
    })
    .Columns(col =>
    {
        col.Field("UserName").HeaderText("User Name").EditType(EditingType.String).Add();
        col.Field("UserEmail").HeaderText("User Email").EditType(EditingType.String).Add();
        col.Field("Role").HeaderText("Role").EditType(EditingType.Dropdown).ValidationRules(v => v.AddRule("required", true).AddRule("minlength", 3)).DataSource(ViewBag.ds).Add();
    }))


Role column still allows empty selection, even with validation. Datasource came from backend with list of string.
How can I solve this issue?

Thanks

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On August 29, 2017 01:02 PM

Hi Than, 
  
Thanks for contacting Syncfusion Support. 
  
We have checked your query and prepared sample with dropdown column for the Grid. But we are unable to reproduce the issue “validation is not working for the Grid dropdown column”. Please make ensure that you have added the “jquery.validate.min.js” file in your script section. Please refer to the sample and screenshot:- 
 
 
  
Sample Link:-  http://www.syncfusion.com/downloads/support/directtrac/132355/SAMPLE~1-794059454.ZIP 
  
 We need some additional information to find the cause of the issue. Could you please share us the following details given below. 
  
1. Grid code example ( both in server side and client side).  
  
2. Share your Layout.cshtml page. Also share screenshot as like above.  
  
3. If possible, provide an issue reproducing sample or hosted link or replicate the issue in the provided sample.  
  
4.  Essential studio product version details. 
  
The provided information will help us to analyze and provide you the solution as early as possible.     
  
Regards, 

 
Farveen sulthana T




Than Htike Aung
Replied On August 29, 2017 10:24 PM

Thanks for reply Farveen sulthana T.

I found out that "jquery.validate.min.js" is not included in render list even though there is such file already existed in project list.

After I included that file in _Layout, it works fine and problem is solved.

FYI, I used Syncfusion project template to create project.

Best regards,

Aung



Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On August 30, 2017 12:12 PM

Hi Aung, 
  
Thanks for your update. We are glad to know that your reported problem has been resolved.  
  
Please get back to us if you need any further assistance. 
  
Regards, 
  
Farveen Sulthana T 


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.

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.

;