I am using Syncfusion Grid in a Blazor Core 3.1.0 App. I am binding data through a Web API. Now I want to show a dropdown list in one of the columns.
By this URL:
Api/Default/GetProjectsList
I get the key and value pair that I need to bind to the drop-down list's text and value.
I have used the EjsDropDownList control and bound the data with the list. But how to show this list as a column in the Grid is where I am struggling at. Tried enclosing it in a tag but the list has not become a part of the Grid.
Please help.
Thanks in advance.
<EjsGrid TValue="Order" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
<EjsDataManager Url="/Api/Orders" Adaptor="Adaptors.WebApiAdaptor"></EjsDataManager>
<GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Normal"></GridEditSettings>
<GridColumns>
<GridColumn>
<EjsDropDownList TValue="string" Placeholder="Select a Project">
<EjsDataManager Url="/Api/Default/GetProjectsList" Adaptor="Adaptors.WebApiAdaptor" CrossDomain=true></EjsDataManager>
<DropDownListFieldSettings Text="Item1" Value="Item2"></DropDownListFieldSettings>
</EjsDropDownList>
</GridColumn>
<GridColumn Field=@nameof(Order.OrderId) DefaultValue="0" IsIdentity="true" IsPrimaryKey="true" HeaderText="ID" TextAlign="TextAlign.Right">
</GridColumn>
</GridColumns>
</EjsGrid>