Dear sir
My Code
<EjsGrid TValue="UnitOfMeasureDto" AllowFiltering="true" AllowReordering="true" AllowResizing="true" @ref="UnitOfMeasureGrid" DataSource="@unitofmeasures" ModelType="@unitofmeasure" AllowPaging="true" Toolbar="@(new List<string>() {"Search"})" Width="100%" AllowExcelExport="true" AllowPdfExport="true" Height="auto">
<GridEditSettings AllowDeleting="true" ShowDeleteConfirmDialog="true"></GridEditSettings>
<GridPageSettings PageSizes="true"></GridPageSettings>
<GridFilterSettings Type="Syncfusion.EJ2.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
<GridEvents TValue="UnitOfMeasureDto" OnActionComplete="OnComplete" OnRecordDoubleClick="onDoubleClick" />
<GridColumns>
<GridColumn Field=@nameof(UnitOfMeasureDto.UnitOfMeasureId) Visible="false" IsPrimaryKey="true"></GridColumn>
<GridColumn Field=@nameof(UnitOfMeasureDto.GSTCode) HeaderText="GST Code" Width="160"></GridColumn>
<GridColumn Field=@nameof(UnitOfMeasureDto.GSTName) Width="200" HeaderText="GST Name"></GridColumn>
<GridColumn Field=@nameof(UnitOfMeasureDto.MeasurementId) Width="200" HeaderText="Measurement Type" ForeignKeyValue="Value" ForeignKeyField="MesurementId" DataSource="@metaInfoMesurements"></GridColumn>
<GridColumn HeaderText="Manage" Width="150">
<GridCommandColumns>
<GridCommandColumn Type="CommandButtonType.Delete" ButtonOption="@(new CommandButtonOptions() { IconCss = "e-icons e-delete", CssClass = "e-flat" })"></GridCommandColumn>
@*<GridCommandColumn ButtonOption="@(new CommandButtonOptions() { Content = @Enum.GetName(typeof(MeasurementType), 5), CssClass = "e-flat" })"></GridCommandColumn>*@
</GridCommandColumns>
</GridColumn>
</GridColumns>
</EjsGrid>
@if (GridEditDialog)
{
<EjsDialog @ref="GridEditDialogObj" Target="body" Width="450px" @bind-Visible="@GridEditDialog" CssClass="e-edit-dialog" IsModal="true" ShowCloseIcon="true" Header="@gridEditHeader" AnimationSettings="@dialogAnnimation" EnableResize="true">
<ChildContent>
<EditForm Model="@UnitOfMeasureEditModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator></DataAnnotationsValidator>
<div class="field-container contact-container m-2 p-2">
<div class="form-group">
<EjsTextBox CssClass="e-field" Placeholder="GST Code" FloatLabelType="@FloatLabelType.Auto" @bind-Value="@UnitOfMeasureEditModel.GSTCode"></EjsTextBox>
<ValidationMessage For="@(() => UnitOfMeasureEditModel.GSTCode)" />
</div>
<div class="form-group">
<EjsTextBox CssClass="e-field" Placeholder="GST Name" FloatLabelType="@FloatLabelType.Auto" @bind-Value="@UnitOfMeasureEditModel.GSTName"></EjsTextBox>
<ValidationMessage For="@(() => UnitOfMeasureEditModel.GSTName)" />
</div>
<div class="form-group">
<div class="form-group">
<p> Measurement Type</p>
<br />
@foreach (var measurement in this.metaInfoMesurements)
{
<EjsRadioButton Label="@measurement.Value" Name="MeasurementType" Value="@measurement.Value" Checked="UnitOfMeasureEditModel.MeasurementId == measurement.MesurementId" @onchange="@(() => UnitOfMeasureEditModel.MeasurementId = measurement.MesurementId)"></EjsRadioButton>
}
<br />
</div>
</div>
</div>
<div class="e-footer-content">
<div class="button-container">
<button type="button" class="e-btn e-normal" @onclick="@onUpdateCancelClick">Cancel</button>
<button type="submit" class="e-btn e-normal e-primary">@saveButton</button>
@*<button type="button" class="e-btn e-normal e-primary" @onclick="@UpdateEditModel">Update</button>*@
</div>
</div>
</EditForm>
</ChildContent>
</EjsDialog>
EjsDialog DialogObj, GridEditDialogObj;
private string UnitOfMeasureHeader { get; set; } = "New Unit Of Measure";
private string gridEditHeader { get; set; } = "Unit Of Measure Details";
private bool ShowButtons { get; set; } = true;
private string saveButton { get; set; }
private bool IsShowUnitOfMeasureEditDialog { get; set; } = false;
public bool GridEditDialog { get; set; } = false;
public async Task onDoubleClick(RecordDoubleClickEventArgs<UnitOfMeasureDto> args)
{
await this.showDialog(args.RowData);
}
private async Task showDialog(UnitOfMeasureDto data)
{
saveButton = "Update";
GridEditDialog = true;
ApiResponseDto apiResponse = await Http.GetJsonAsync<ApiResponseDto>("api/UnitOfMeasure/" + data.UnitOfMeasureId);
// ApiResponseDto apiResponseproductcategory = await Http.GetJsonAsync<ApiResponseDto>("api/productcategory");
if (apiResponse.StatusCode == 200)
{
//
UnitOfMeasureEditModel = Newtonsoft.Json.JsonConvert.DeserializeObject<UnitOfMeasureDto[]>(apiResponse.Result.ToString()).ToList<UnitOfMeasureDto>().FirstOrDefault();
// productcategory = Newtonsoft.Json.JsonConvert.DeserializeObject<ProductCategoryDto[]>(apiResponseproductcategory.Result.ToString()).ToList<ProductCategoryDto>();
StateHasChanged();
matToaster.Add(apiResponse.Message, MatToastType.Success, "UOM Retrieved");
}
else
{
matToaster.Add(apiResponse.Message + " : " + apiResponse.StatusCode, MatToastType.Danger, "UOM List Retrieval Failed");
}
}
Some Time Header display bottom of dialog. Why this happens frequently?.
Please give your idea to resolve this issue.
Thanks & Regards
Vijay