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
close icon

Validations

Hi Guys,

I am trying to use validations as per documentation but no luck i am using Asp.net Core 2 and Grid control

@using Syncfusion.JavaScript.Models


@{
    ViewBag.Title = "Brand Grid";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<br />
<div id="ControlRegion">
    <ej-grid id="BrandGrid"
             allow-sorting="true"
             allow-searching="true"
             allow-grouping="true" group-settings="@(new GroupSettings() {GroupedColumns = new List<string>() {"BrandId"}})"
             allow-filtering="true" filter-settings="@(new FilterSettings() {FilterType = FilterType.Excel})"
             allow-row-drag-and-drop="true" row-drop-settings="@(new RowDropSettings() {DropTargetID = "#BrandGrid"})"
             allow-paging="true"
             allow-scrolling="true">

        <e-datamanager json="ViewBag.branddatasource" update-url="Brand/Update" insert-url="Brand/Insert" remove-url="Brand/Delete" adaptor="remoteSaveAdaptor" />
        <e-toolbar-settings show-toolbar="true" toolbar-items=@(new List<string> {"add", "edit", "delete", "update", "cancel"}) />
        <e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true" edit-mode="@(EditMode.Normal)"></e-edit-settings>
        <e-context-menu-settings enable-context-menu="true"></e-context-menu-settings>
        <e-columns>
            <e-column field="BrandId" width="35" visible="false" is-primary-key="true"></e-column>
            <e-column field="BrandName" header-text="Name" width="120" text-align="Left" tooltip="#colTip" css-class="edmund" clipmode="EllipsisWithTooltip"></e-column>
            <e-column field="BrandDescription" header-text="Description" text-align="Left" width="150" css-class="edmund" tooltip="#colTip" clipmode="EllipsisWithTooltip" validation-rules='@(new Dictionary<string,object> {{"required",true}})'></e-column>
        </e-columns>
    </ej-grid>
</div>

<script type="text/template" id="colTip">
    {{:value}}
</script>

<style type="text/css" class="cssStyles">
    .edmund {
        font-family: Lora;
        font-size: 11px;
    }

    .edmund1 {
        margin-left: 10px;
    }

    .ej-grid .ej-gridheader { /* grid header font color and styles*/
        font-family: Lora;
        font-size: 11px;
    }
</style>

I have attached code, thanks in advance

Regards

Edmund Herbert

2 Replies

EH Edmund Herbert September 4, 2017 11:44 AM UTC

Hi sorry i found another thread that had example that worked



VA Venkatesh Ayothi Raman Syncfusion Team September 5, 2017 04:08 AM UTC

Hi Edmund, 

Thanks for the update. 

We are very happy to hear that your requirement is achieved. 

Regards, 
Venkatesh Ayothiraman. 


Loader.
Live Chat Icon For mobile
Up arrow icon