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. Image for the cookie policy date

Dialog title

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" />
                    <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">

                            <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>*@

@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">
            <EditForm Model="@UnitOfMeasureEditModel" OnValidSubmit="@HandleValidSubmit">

                <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 class="form-group">
                        <EjsTextBox CssClass="e-field" Placeholder="GST Name" FloatLabelType="@FloatLabelType.Auto" @bind-Value="@UnitOfMeasureEditModel.GSTName"></EjsTextBox>
                        <ValidationMessage For="@(() => UnitOfMeasureEditModel.GSTName)" />

                    <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 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>*@


  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>();

            matToaster.Add(apiResponse.Message, MatToastType.Success, "UOM  Retrieved");

            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

3 Replies

PM Pandiyaraj Muniyandi Syncfusion Team November 11, 2019 11:36 AM UTC

Hi Vijay, 
Greetings from Syncfusion support. 
We have tried to replicate the issue with the shared sample code blocks (without any modification), but we were unable to reproduce the issue at our end. We followed the following ways: 
  • On double click the Grid row to display the dialog element with the corresponding record fetch and update into form elements
  • Close and open a dialog by updating Visible property
We have prepared sample for your reference and download it from below link 
Could you please clearing the local browser cache and try the same application? Or Can you please provide the replication procedure with sample or modify the above sample to reproduce your issue and revert it to us. This will help us provide a solution at earliest. 

VI vijaymohan November 11, 2019 12:48 PM UTC

Dear Pandiyaraj

Great Thanks. Issue resolved.   Adding await Task.Delay(100); solve the issue.

Thanks & Regards

PM Pandiyaraj Muniyandi Syncfusion Team November 12, 2019 08:36 AM UTC

Hi Vijay,  
Thanks for your update.  
We glad to hear that the provided sample resolved your problem. Kindly let us know if you need further assistance on this.

Live Chat Icon For mobile
Up arrow icon