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

Required tooltip

Please,

how can I solve this little problem.
I have the grid for editing like this



and I want to add new record



but when I leave the first column without enter something



I got the scrollbar inside the edit row with required message.

This is my grid:

<ejs-grid id="gridZapVr" locale="hr" toolbar="@(new List<string>() {"Search", "Add", "Edit", "Delete", "Update", "Cancel" })"
                              gridLines="Both" allowSorting="true"
                              allowPaging="true" allowTextWrap="true">
                        <e-data-manager url="/Placa/Plobracuns/PlobracunZapVrDataSource" insertUrl="/Placa/Plobracuns/PlobracunZapVrInsert" updateUrl="/Placa/Plobracuns/PlobracunZapVrUpdate" removeUrl="/Placa/Plobracuns/PlobracunZapVrDelete" adaptor="UrlAdaptor"></e-data-manager>
                        <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" showDeleteConfirmDialog="true"></e-grid-editSettings>
                        <e-grid-columns>
                            <e-grid-column field="OpzapVrid" isPrimaryKey="true" headerText="OpzapVrid" visible="false" width="65"></e-grid-column>
                            <e-grid-column field="OpzapId" headerText="OpzapId" visible="false" width="65"></e-grid-column>
                            <e-grid-column field="VrstaRadaId" headerText="Vrsta rada" validationRules="@(new { required=true})" width="200px"></e-grid-column>
                            <e-grid-column field="Sati" headerText="Sati" width="150px" type="number" format="N2" headerTextAlign="Right" textAlign="Right"></e-grid-column>
                            <e-grid-column field="DanOd" headerText="Dan od" width="150px" type="number" format="N0" headerTextAlign="Right" textAlign="Right"></e-grid-column>
                            <e-grid-column field="DanDo" headerText="Dan do" width="150px" type="number" format="N0" headerTextAlign="Right" textAlign="Right"></e-grid-column>
                            <e-grid-column field="KoefVr" headerText="Koef. VR" width="100px" type="number" format="N2" defaultValue="1" headerTextAlign="Right" textAlign="Right"></e-grid-column>
                            <e-grid-column field="IznosBruto" headerText="Bruto" width="150px" type="number" format="N2" defaultValue="0" headerTextAlign="Right" textAlign="Right"></e-grid-column>
                            <e-grid-column field="IznosNeto" headerText="Neto" width="150px" type="number" format="N2" defaultValue="0" headerTextAlign="Right" textAlign="Right"></e-grid-column>
                            <e-grid-column field="IznosUk" headerText="Ukupno" width="150px" type="number" format="N2" defaultValue="0" headerTextAlign="Right" textAlign="Right"></e-grid-column>
                        </e-grid-columns>
                    </ejs-grid>

Thanks!
Bernard.

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team November 13, 2019 09:27 AM UTC

Hi Bernard, 
 
Greetings from Syncfusion support. 

We have modified the existing Grid.createTooltip method in sample level based on your requirement “To show the validation message without creating the scrollbar”. In the below code example, we have achieved the workaround sample for validation message. 

Please refer to the below code and sample link. 

<ejs-grid id="Grid" allowPaging="true" actionComplete="actionComplete" toolbar="@(new List<string>() {"Add", "Delete", "Update", "Cancel" })"> 
    <e-data-manager url="/Home/UrlDataSource" adaptor="UrlAdaptor" insertUrl="/Home/Insert" updateUrl="/Home/Update" removeUrl="/Home/Remove"></e-data-manager> 
 
    <e-grid-columns> 
        <e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" validationRules="@(new { required=true})" textAlign="Right" width="100"></e-grid-column> 
        <e-grid-column field="CustomerID" headerText="Customer ID" validationRules="@(new { required=true})" width="120"></e-grid-column> 
. . . . 
    </e-grid-columns> 
</ejs-grid> 
<script> 
    function actionComplete(args) { 
        var grid = document.getElementsByClassName("e-grid")[0].ej2_instances[0]; 
        if (args.requestType == "beginEdit" || args.requestType == "add") { 
            grid.editModule.createTooltip = function (element, error, name, display) { 
                . . . . . 
    } 
</script> 



Regards, 
Thavasianand S. 



BJ Bernard Jurlina November 14, 2019 08:00 PM UTC

Hi Thavasianand!

Excellent....it works like a charm.
Syncfusion support is the best! :)

Regards!
Bernard.


PS Pavithra Subramaniyam Syncfusion Team November 15, 2019 07:16 AM UTC

Hi Bernard,  

Thanks for your update. 

We are glad to hear that the provided solution is worked. 

Please contact us if you need any further assistance. As always, we will be happy to assist you.  

Regards,  
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon