Position center and height for C1Dialog 2025v2 399

Posted by: enrique.pv-ext on 3 June 2026, 2:58 am EST

    • Post Options:
    • Link

    Posted 3 June 2026, 2:58 am EST

    Hi,

    Migrate from 2010v1 to 2025v2 399 in ASP.NET WebForms NET Framework 4.8.1.

    Using C1Dialog from C1.Web.Wijmo.Controls.48.dll

    using

    c1dialog({ position: 'center' });


    and

    c1dialog({ height: height });

    is valid ?

        dialog = $("#<%= VoucherBreakDownWindow.ClientID %>");
        if (height) {
            dialog.c1dialog({ height: height });
        }
        dialog.c1dialog({
            modal: true
        });
        dialog.c1dialog({ position: 'center' });
        dialog.c1dialog("open");

    any suggestions ?

  • Posted 3 June 2026, 5:25 am EST

    Hello Enrique,

    Each call to c1dialog({ … }) (passing a plain object) is treated as a constructor/initialization call in jQuery UI-style widgets. Calling it multiple times like this can cause each call to reset or overwrite previously set options, because it may re-initialize the widget from scratch each time.

    The correct way is to call c1dialog(“option”, “key”, value) jQuery widget pattern for updating options on an already-initialized widget. It modifies the live instance without re-creating it as follows:

    var dialog;
    var height = '500';
    function OpenDialog() {
        dialog = $("#<%= VoucherBreakDownWindow.ClientID %>");
        if (height) {
            dialog.c1dialog("option", "height", height);
        }
        dialog.c1dialog("option", "modal", true);
        dialog.c1dialog("option", "position", 'center' );
        dialog.c1dialog("open");
    }

    Sample: Dialog_Sample.zip

    Please let us know if you have further queries.

    Regards,

    Uttkarsh.

  • Posted 9 September 2026, 10:02 am EST - Updated 10 September 2026, 2:10 am EST

    defalult position for legacy ?? center ?? bottom-center ??

                                dialog = $find("<%= ViewDataLiquidated.ClientID %>");
    
      //    dialog.set_startPosition(C1.Web.UI.Controls.C1Window.C1WindowPosition.page);
      //    dialog.set_verticalAlign(C1.Web.UI.Controls.C1Window.VerticalPosition.middle);
      //    dialog.set_horizontalAlign(C1.Web.UI.Controls.C1Window.HorizontalPosition.center);
    
    			dialog.showModal();
    			//dialog.set_startPosition(1);
    			//dialog.set_verticalAlign(1);
    			//dialog.set_horizontalAlign(1);
    

    default position is center?

    dialog.c1dialog({ modal: true });
     dialog.c1dialog('open');

    Not required in JS then

    c1dialog('option', 'position', 'center'); 
    <cc4:C1Dialog ID="ViewDataLiquidated" runat="server"
        Position="center" ShowOnLoad="false" Resizable="false" ...>

    If Position=“center” in markup , not is required in JS ?

    $("#<%= ViewDataLiquidated.ClientID %>").c1dialog('option', 'position', 'center');

    If Modal=“True” in markup , not is required in JS ?

    <cc4:C1Dialog ID="ViewDataLiquidated" runat="server"
        Position="center" ShowOnLoad="false" Resizable="false" Modal="True"
        Title="Datos Liquidación"
        Width="870px" Height="380px">
    

    $("#<%= ViewDataLiquidated.ClientID %>").c1dialog('option', 'modal', true);
  • Posted 10 September 2026, 9:04 am EST

    Hello Enrique,

    Regarding your questions:

    → Default position for legacy dialogs (showModal()):

    The legacy showModal() dialog’s default position was center. In the new C1Dialog (Wijmo-based), the default position is also center, so you shouldn’t need to set it explicitly if center is what you want.

    → Position=“center” in markup — is the JS call still needed?

    No, if you set Position=“center” in the server-side markup, it will be applied when the dialog initializes, so you don’t need to call c1dialog(‘option’, ‘position’, ‘center’) in JS as well. The JS call is only needed if you want to change the position dynamically at runtime, after the dialog has already initialized (for example, switching position based on some condition).

    → Modal=“True” in markup — is the JS call still needed?

    Same applies here. If Modal=“True” is set in markup, the dialog will be modal on initialization, so the corresponding JS call is redundant unless you need to toggle modal behavior dynamically after the dialog is already rendered.

    In general, we’d recommend setting static values like Position and Modal directly in markup where possible, and reserving the JS option calls for cases where the value needs to change at runtime (like your height example, which depends on a JS variable).

    Please let us know if you run into a specific case where the markup value doesn’t seem to be respected.

    Regards,

    Uttkarsh

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels