Hi,
I have an issue : using Grid with the EditMode.Dialog mode, I can't add items to my Grid, even though I can edit and delete elements.
Actually, when I press the "save" button, nothing happens and the dialog remains (only at creation of elements as mentioned before).
The fact is : It works with the EditMode.Batch mode.
Here is the code :
------------------------------------------
<div class="col-lg-12 control-section" style="margin-bottom:15px">
<div class="content-wrapper">
<div class="row">
<SfGrid ID="campaingGrid"
DataSource="@marketingCampaignList"
Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update", "Search" })"
AllowResizing="true"
AllowPaging="true"
AllowSelection="@boolSelect"
AllowSorting="true"
AllowFiltering="true">
<GridEditSettings AllowAdding="true"
AllowEditing="true"
AllowDeleting="true"
Mode="EditMode.Dialog">
</GridEditSettings>
<GridPageSettings PageSize="5"></GridPageSettings>
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
<!--<GridEvents RowSelected="RowSelectHandlerCampaign" TValue="MarketingCampaign"></GridEvents>
<GridEvents OnDialogSave="OnDial" TValue="MarketingCampaign"></GridEvents>-->
<GridColumns>
<GridColumn Field=@nameof(MarketingCampaign.MarketingCampaignName) HeaderText="Name" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="40"></GridColumn>
<GridColumn Field=@nameof(MarketingCampaign.MarketingCampaignDescription) HeaderText="Description" Width="45"></GridColumn>
<GridColumn Field=@nameof(MarketingCampaign.MarketingCampaignStartDate) HeaderText="Start Date" Format="dd.MM.yyyy" Type="Syncfusion.Blazor.Grids.ColumnType.Date" TextAlign="TextAlign.Right" Width="40"></GridColumn>
<GridColumn Field=@nameof(MarketingCampaign.MarketingCampaignEndDate) HeaderText="End Date" Format="dd.MM.yyyy" TextAlign="TextAlign.Right" Width="40"></GridColumn>
<GridColumn Field=@nameof(MarketingCampaign.MarketingCampaignType) HeaderText="Type" TextAlign="TextAlign.Right" Width="40"></GridColumn>
<GridColumn Field=@nameof(MarketingCampaign.MarketingCampaignGroup) HeaderText="Group" TextAlign="TextAlign.Right" Width="40"></GridColumn>
<GridColumn Field=@nameof(MarketingCampaign.MarketingCampaignStatus) HeaderText="Status" TextAlign="TextAlign.Right" Width="40"></GridColumn>
<GridColumn Field=@nameof(MarketingCampaign.MarketingCampaignExpectedRevenue) HeaderText="Expected Revenue" TextAlign="TextAlign.Right" Width="70"></GridColumn>
</GridColumns>
</SfGrid>
</div>
</div>
</div>
------------------------------------------
Have I missed something ?
Thanks in advance.
Regards,
Quentin VEILLAS
Everything is OK ! Thanks !
I have the exact same issue, how did you solve it?
Editing/deleting works fine, but when adding, the save button does not seem to trigger any Grid events, it only seems to check the validation rules.
And because of this post I've tried if batch-editing works, and like you've said, this does work.
The exact same lines of code work in another solution using the same versions of the Syncfusion Nuget packages.
Thank you for the suggestions.
These steps didn't help but I've found a workaround.
Adding works when I use a custom class with a nullable ID field.
After this I could add items as expected.
Regards,
Stan