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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using DataSource property of Grid Column to show DropDown list in editing

Thread ID:

Created:

Updated:

Platform:

Replies:

149373 Nov 23,2019 11:55 AM UTC Nov 25,2019 01:04 PM UTC Blazor 1
loading
Tags: Grid
Junaid
Asked On November 23, 2019 12:10 PM UTC

Good day,

I have a GridColumn in which I want to show a simple drop-down list that contains two values i.e. "In progress" and "Completed". I have used the EditType.DropDown property and during editing a drop-down appears as well but it is empty with no text. I have used the DataSource property in GridColumn but the text is not being displayed. How can I display the text dropdown? 

It is to be noted here that I am using WebApiAdaptor with EjsDataManager to display and perform CRUD operations on data. 

<EjsGrid TValue="Projekte" AllowPaging="true" AllowFiltering="true" AllowSorting="true" Toolbar="@(new List() { "Add", "Edit", "Delete", "Cancel", "Update" })">
            <EjsDataManager Url="/Api/Default" Adaptor="Adaptors.WebApiAdaptor">EjsDataManager>
            <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Normal">GridEditSettings>
            <GridColumns>
                <GridColumn Field=@nameof(Projekte.Id) AllowEditing="false"HeaderText="ID" TextAlign="TextAlign.Right">GridColumn>
                <GridColumn Field=@nameof(Projekte.Status) HeaderText="Status" EditType="EditType.DropDownEdit" TextAlign="TextAlign.Right"
            DataSource="@status"> GridColumn>
            GridColumns>
        EjsGrid>

@code{
    public List<string> status { setget}
    protected override void OnInitialized()
    {
        status   = new List<string>{"In Process","Completed"};
    }
}

P.S. I have tried using the Template inside the grid column (as shown here: https://www.syncfusion.com/forums/149233/syncfusion-blazor-binding-drop-down-list-in-grid-column) but it gives me an error. 

Error
The child content element 'Template' of component 'GridColumn' uses the same parameter name ('context') as enclosing child content element 'Authorized' of component 'AuthorizeView'. Specify the parameter name like: '