Does Spreadsheet support Modal Validation on server side?

2 posts, 0 answers
  1. Prashant
    Prashant avatar
    1 posts
    Member since:
    Jun 2016

    Posted 15 Jun Link to this post

    Hi,

    I am uploading an excel file and display it into spreadsheet. I want that when i upload an excel file, i fetch the records(say: ABC Class type) from posted file and validate using fluent validation. If there are any validation failure then it will be marked on the spreadsheet.

  2. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 17 Jun Link to this post

    Hello Prashant,

    The built-in validation of the Spreadsheet works on the client: https://demos.telerik.com/aspnet-mvc/spreadsheet/validation

    Nevertheless, when you upload an excel file, the data is exposed via a Workbook instance on the server: https://demos.telerik.com/aspnet-mvc/spreadsheet/server-side-import-export. This instance allows you to access the data and modify it if needed, so you can perform a custom validation at that point.
    [HttpPost]
    public ActionResult Upload(HttpPostedFileBase file)
    {
        var workbook = Workbook.Load(file.InputStream, Path.GetExtension(file.FileName));
        return Content(workbook.ToJson(), Telerik.Web.Spreadsheet.MimeTypes.JSON);
    }


    Regards,
    Slav
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top