how to add blank space in dropdown list

  <ejs-grid #grid [dataSource]=' data' [allowPaging]="true" [toolbar]='toolbar' showColumnChooser='true'
    [editSettings]='editSettings' (toolbarClick)='toolbarClick($event)' [allowResizing]="true"
    [filterSettings]='filterOptions' [pageSettings]='pageSettings' [filterSettings]='filterSettings'
    [groupSettings]='groupOptions' [allowFiltering]='true' (actionBegin)="actionBegin($event)">
    <e-columns>
      <e-column id='diacritics' field='parentReferenceId' headerText='Parent Reference Id' editType='dropdownedit'
        [edit]='dpParams' [allowFiltering]='true' [ignoreAccent]='true' filterBarPlaceholder='e.g: 10001'>
      </e-column>

1 Reply

RR Rajapandi Ravi Syncfusion Team February 15, 2022 02:23 PM UTC

Hi Sunil, 

Greetings from Syncfusion support 

You can add an empty item in the dropdown data source to add blank space in the Dropdown List. Please refer the below code example and sample for more information. 
 
App.component.ts 
 
public country: any = [ 
        { ShipCountry: 'United States', countryId: '1' }, 
        { ShipCountry: '', countryId: '' }, 
        { ShipCountry: 'Australia', countryId: '2' }, 
        { ShipCountry: 'India', countryId: '2' } 
    ]; 

public ngOnInit(): void { 
        this.dpParams = { params: { 
            query: new Query(), 
            dataSource: this.country
            fields: { value: 'ShipCountry', text: 'ShipCountry' }, 
            allowFiltering: true} }; 
} 

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='ShipCountry' headerText='Ship Country' width='150' editType='dropdownedit' [edit]='dpParams'></e-column> 
            </e-columns> 
        </ejs-grid> 


Screenshot: 

 

Regards, 
Rajapandi R 


Loader.
Up arrow icon