startPosition and X and Y methods C1Window to C1Dialog 2025v2 399

Posted by: enrique.pv-ext on 14 January 2026, 11:15 am EST

    • Post Options:
    • Link

    Posted 14 January 2026, 11:15 am EST

    Hi,

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

    Migrating C1Window to C1Dialog 2025v2 399.

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

    I have the older code javasciprt:

    var dialog = $find(C1WindowClientID);
    	dialog.set_startPosition(position);
    
    	dialog.set_x(200);
    	dialog.set_y(250);

    I have now the code javasciprt:

    	var dialog = $("#" + C1WindowClientID);
    	dialog.c1dialog({
    		title: TitleText,
    		modal: true
    	});
    	dialog.c1dialog("open");

    Which is the alternative now, for C1Dialog 2025v2 399

    how-to use c1dialog for set startPosition ?

    how-to use c1dialog for set X ?

    how-to use c1dialog for set Y ?

    		dialog.set_startPosition(position)
    		dialog.set_x(200)
    		dialog.set_y(250);

    Thanks a lot

  • Posted 15 January 2026, 4:23 am EST

    Hi Kiquenet,

    You can set the position property of the C1Dialog to set the position of the modal.

    The Position property specifies where the dialog should be displayed. Possible values: 1) a single string representing position within viewport: ‘center’, ‘left’, ‘right’, ‘top’, ‘bottom’. 2) a string with array format containing an x,y coordinate pair in pixel offset from left, top corner of viewport (e.g. “[350,100]”) 3) a string with array format containing x,y position string values (e.g. “[‘right’,‘top’]” for top right corner).

    Please refer to the following pages of our documentation for more details on the position property:

    Sample Code(JS)

        <script type="text/javascript">         
                function openDialog() {
                    var dialog = $('#<%= C1Dialog1.ClientID %>');
                    dialog.c1dialog({position:'left'});
                    //Option 2 for setting X and Y dialog.c1dialog({position:'[80,900]'});
                }
        </script>
                    <input id="Button1" type="button" onclick="openDialog()" value="Show Dialog" />
                    <wijmo:C1Dialog ID="C1Dialog1" runat="server" ShowOnLoad="false"
                        Position="right"
                        >
                        <Content>
                            Hi there!
                            </Content>
                    </wijmo:C1Dialog>
    

    Regards,

    Akshay

  • Posted 15 January 2026, 5:49 am EST

    Great Akshay, but more help me, please

    I was using older version in my code (javascript and C#): C1WindowPosition, VerticalPosition and HorizontalPosition

    C1.Web.UI.Controls.3, Version=3.5.20101.174, Culture=neutral, PublicKeyToken=9b75583953471eea
    namespace C1.Web.UI.Controls.C1Window
    {
    	public enum C1WindowPosition
    	{
    		//     Default position of the C1Window.x = y = 0
    		ByDefault = 0,
    		//     Center of the page.
    		Page = 1,
    		//     Center of the parent element of the dialog window.
    		Parent = 2,
    		//     Position determines by the C1.Web.UI.Controls.C1Window.C1Window.X and C1.Web.UI.Controls.C1Window.C1Window.Y  properties.
    		Manual = 3,
    		//     OffSet Mode
    		OffSet = 4
    	}
    }
    	public enum VerticalPosition
    	{
    		//     Top region
    		Top = 0,
    		//     Middle region
    		Middle = 1,
    		//     Bottom region
    		Bottom = 2
    	}
    	public enum HorizontalPosition
    	{
    		//     Left region
    		Left = 0,
    		//     Center rgion
    		Center = 1,
    		//     Right region
    		Right = 2
    	}

    Now, new version C1Dialog about Position property , help reference:

    1. a single string representing position within viewport: ‘center’, ‘left’, ‘right’, ‘top’, ‘bottom’.
    2. a string with array format containing an x,y coordinate pair in pixel offset from left, top corner of viewport (e.g. “[350,100]”)
    3. a string with array format containing x,y position string values (e.g. “[‘right’,‘top’]” for top right corner).

    I try change code from older C1Windows to new C1Dialog:

    // Position determines by the C1.Web.UI.Controls.C1Window.C1Window.X and C1.Web.UI.Controls.C1Window.C1Window.Y properties.

    C1WindowPosition: Manual = 3,

    	dialog.set_startPosition(position);
    	dialog.set_x(200);
    	dialog.set_y(250);

    I think this will be the new code:

        //Option 2 for setting X and Y 
    	dialog.c1dialog({position:'[200,250]'});
    	//     Center of the page.
    	C1WindowPosition: Page = 1,
    	//     Middle region
    	VerticalPosition: Middle = 1,
    	//     Center rgion
    	HorizontalPosition: Center = 1,
    
    	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);

    I dont know if this will be the new code??

         dialog.c1dialog({position:'center'}); ??
        // or
    	dialog.c1dialog({position:'["center","center"]'}); ??

    Please, any help ? thx a lot!!

  • Posted 16 January 2026, 12:58 am EST

    Hi,

    The new code

    dialog.c1dialog({position:'center'});
    should work fine.

    Regards,

    Akshay

Need extra support?

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

Learn More

Forum Channels