Hello,
I have a grid with several fields, two of which the EditType is set to DropDownList for facilitating data entry. However, these two fields did not allow the user to add new values during entry.
How can I enable these two fields to accept user input of a new value?
Best regards
Sao
Hi Sao,
Sorry we are not clear about your query. You are saying that you have to save the new value that entered in search box of dropdown list. If yes, it is not possible to save because the default behaviour of DropDownEdit is that allows users to edit grid cells using a dropdown control. It is typically used when a column in the grid has a fixed set of values, and the user needs to select one of them to update the cell value.
If not kindly share us the below requested details for further validation:
1.Kindly share us the entire entire grid code snippet.
2.Video demo of issue replication.
3.If possible kindly share us the simple issue reproducible sample .
The above requested details will be helpful to validate further at our end and provide solution as earlier as possible.
Please get back to us if you have further queries.
Regards,
Bala.
Syncfusion support Team.
Dear Bala,
I want to provide users with an easy way to select 'Ship City' by adding EditType="EditType.DropDownEdit". However, when users decide to add a new Ship City (which is not on the list) during editing or adding a new record.
My question was is there a way to enter a new Ship City which is not on the list in the Order table while EditType="EditType.DropDownEdit"?
Here is my code:
<SfGrid DataSource="@OrdersList" AllowFiltering="true" AllowPaging="true" Toolbar="@toolbarFull">
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Excel"></GridFilterSettings>
<GridPageSettings PageCount="10"></GridPageSettings>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Dialog"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(Orders.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Center" Width="20" IsPrimaryKey=true IsIdentity=true></GridColumn>
<GridColumn Field=@nameof(Orders.OrderDate) HeaderText="Order Date" TextAlign="TextAlign.Center" Width="20"></GridColumn>
<GridColumn Field=@nameof(Orders.ShipCity) HeaderText="Ship City" TextAlign="TextAlign.Left" Width="20" EditType="EditType.DropDownEdit"></GridColumn>
</GridColumns>
</SfGrid>
@code {
string[] toolbarFull = { "Edit", "Cancel", "Update", "ExcelExport", "PdfExport", "Search", "Print", "ColumnChooser" };
public IEnumerable<Orders> OrdersList { get; set; }
protected override void OnInitialized()
{
OrdersList = MyDBServices.GetOrderList();
}
}
Best regards
Sao
Hi Sao,
Sorry for the inconvenience caused.
You are saying that is there a way to enter a new Ship City which is not on the list in the Order table while EditType="EditType.DropDownEdit" . It is not possible to save because the default behaviour of DropDownEdit is that allows users to edit grid cells using a dropdown control only.
Please get back to us if you have further queries.
Regards,
Bala