Binding combobox runtime

Posted by: vijay-phalak on 10 September 2017, 10:59 am EST

    • Post Options:
    • Link

    Posted 10 September 2017, 10:59 am EST

    Can anyone help me out for creating comboboxes and binding runtime values to them in WPF spread.

  • Posted 10 September 2017, 10:59 am EST

    Hi Guys,

    Any help on this? Particularly in binding combo in WPF Spread.

  • Posted 10 September 2017, 10:59 am EST

    Vijay,

    Sorry for the delay in getting back to you. We have escalated this issue to the development team to seek some assistance on this implementation. We will get back to you as soon as there would be any updates available.

    Regards,

    Sankalp

  • Posted 10 September 2017, 10:59 am EST

    hi,

    any update on this?

  • Posted 10 September 2017, 10:59 am EST

    Hello,

    We haven’t heard back from our developers yet. We have asked for an urgent update on the same at high priority.

    Tracking id for your issue is:-123818

    We will update you once we hear anything from them.

    We regret the inconvenience.

    Thanks,

    Reeva

  • Posted 10 September 2017, 10:59 am EST

    Vijay,

    As per the update from the development team, Spread WPF does not support cell types, but as a workaround you may use Custom Drawing Object. However please note that if you use custom drawing object, then you would need to do a lot of things yourfelf in the code. You can find some sample code to implement a custom drawing object at the following link:

    http://sphelp.grapecity.com/forums/topic/cascading-combobox-in-spread/

    Regards,

    Sankalp

  • Posted 27 May 2022, 12:28 pm EST

    So it’s been about 5 years since this thread. I’ve been able to follow examples in the forums to create my combo boxes for the correct cells, but I can’t find anywhere that shows how I can bind to the values in the cells where the combo boxes are. Is there any example that shows how to get and set those values for use in my combo box? Thank you!

  • Posted 20 June 2022, 7:58 am EST

    Hello Nathan,

    JFYI, SpreadSheet WPF does not support cell types. You need to create Custom Drawing Object for the same as:

    
       public class MyDrawingObjectProvider : IDrawingObjectProvider
        {
            public DrawingObject[] GetDrawingObjects(Worksheet sheet, int row, int column, int rowCount, int columnCount)
            {
                if (row == 1 && column == 1)
                {
                    return new ControlDrawingObject[] { new ControlDrawingObject(row, column, new ComboBox()) };
                }
                return sheet.GetDrawingObject(row, column, rowCount, columnCount);
            }
        }
    
        public class ControlDrawingObject : CustomDrawingObject
        {
            private ComboBox _rootElement;
            public ControlDrawingObject(int row, int col, ComboBox myCombo) : base(row, col) 
            { 
                _rootElement = new ComboBox();
                _rootElement.ItemsSource = Enum.GetValues(typeof(ProductType)); 
                this.ShowDrawingObjectOnly = true; }
            public override FrameworkElement RootElement
            {
                get { return _rootElement; }
            }
        }
    
    

    Please refer the attached sample for the same : SpreadComboBoxDemo.zip

    Best Regards,

    Nitin

Need extra support?

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

Learn More

Forum Channels