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

How to configure custom text for editable column

Hello,

how can I define a custom text for a required field in a grid column edited inline.
I use validationRules but I do not know which property to use for the text.

1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team June 28, 2019 12:42 PM UTC

Hi Adriano, 

Greetings from Syncfusion support. 

We can achieve your requirement using the below code example. 

[app.component.html] 

<ejs-grid #normalgrid id='Normalgrid' [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar' (actionBegin)='actionBegin($event)'> 
            <e-columns> 
                <e-column field='OrderID' headerText='Order ID' width='140' textAlign='Right' isPrimaryKey='true' [validationRules]='orderidrules'></e-column> 
                 
                  --------------- 

            </e-columns> 
        </ejs-grid> 

--------------------------------------------------------------------------------------------------------------------- 
[app.component.ts] 

export class AppComponent { 
    @ViewChild('ddsample') 
    public dropDown: DropDownListComponent; 
    public data: Object[]; 
    public editSettings: Object; 
    public toolbar: string[]; 
    public orderidrules: Object; 

     ---- 

    public ngOnInit(): void { 
        this.data = orderDataSource; 
        this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true , newRowPosition: 'Top' }; 
        this.toolbar = ['Add', 'Edit', 'Delete', 'Update', 'Cancel']; 
        this.orderidrules = { required: [true,'OrderID is required'], number: true }; 
         
        ----- 

   


We have prepared a simple sample in the following link. 


Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon