Best approach X and Y properties C1Window to C1Dialog 2025v2 399

Posted by: enrique.pv-ext on 29 June 2026, 9:59 am EST

    • Post Options:
    • Link

    Posted 29 June 2026, 9:59 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

    Now, this not compiles, about X and Y properties (legacy old C1Window)

            public int X
            {
                get { return PlaceWindow.X; }
                set { PlaceWindow.X = value; }
            }
    
            public int Y
            {
                get { return PlaceWindow.Y; }
                set { PlaceWindow.Y = value; }
            }

    best approach to C1Dialog ? Position (string) vs X and Y (int) ??

    thanks a lot

  • Posted 30 June 2026, 10:41 am EST

    Hi,

    You are seeing this error because C1Dialog utilizes a single string-based Position property instead of explicit X and Y integers.

    To avoid rewriting the rest of your application’s logic, we recommend keeping your X and Y properties as integers. You can simply update their Get and Set accessors to parse and update the C1Dialog.Position string behind the scenes.

    Here is the updated code:

    // Helper method to safely read the string and return an array of [X, Y]
    private int[] GetDialogPosition()
    {
        string pos = PlaceWindow.Position;
        
        // Handle empty or named positions gracefully (defaulting to 0,0)
        if (string.IsNullOrWhiteSpace(pos) || !pos.Contains("["))
            return new int[] { 0, 0 };
    
        try
        {
            // Strip the brackets and split by comma: "[10, 20]" -> "10", " 20"
            string[] coords = pos.Trim('[', ']').Split(',');
            
            if (coords.Length == 2)
            {
                int.TryParse(coords[0].Trim(), out int x);
                int.TryParse(coords[1].Trim(), out int y);
                return new int[] { x, y };
            }
        }
        catch 
        {
            // Fallback safety
        }
        
        return new int[] { 0, 0 };
    }
    
    public int X
    {
        get { return GetDialogPosition()[0]; }
        set { PlaceWindow.Position = $"[{value},{GetDialogPosition()[1]}]"; }
    }
    
    public int Y
    {
        get { return GetDialogPosition()[1]; }
        set { PlaceWindow.Position = $"[{GetDialogPosition()[0]},{value}]"; }
    }

    Best Regards,

    Kartik

Need extra support?

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

Learn More

Forum Channels