GrapeCity.Xaml.SpreadSheet.Data
FloatingObjects Property
Example 


Gets the floating objects.
Syntax
'Declaration
 
Public ReadOnly Property FloatingObjects As FloatingObjects
'Usage
 
Dim instance As Worksheet
Dim value As FloatingObjects
 
value = instance.FloatingObjects
public FloatingObjects FloatingObjects {get;}

Property Value

The floating objects.
Example
This example creates a custom object.
public class MyFloatingObject : GrapeCity.Xaml.SpreadSheet.UI.CustomFloatingObject
        {
            public MyFloatingObject(string name, double x, double y, double width, double height)
                : base(name, x, y, width, height)
            {
            }

            public override FrameworkElement Content
            {
                get
                {
                    Border border = new Border();

                    StackPanel sp = new StackPanel();
                    sp.Children.Add(new Button() { Content = "Label", Background = new SolidColorBrush(Windows.UI.Colors.Blue) });
                    sp.Children.Add(new Button() { Content = "Button", Background = new SolidColorBrush(Windows.UI.Colors.Red) });

                    border.BorderThickness = new Thickness(1);
                    border.BorderBrush = new SolidColorBrush(Windows.UI.Colors.Black);
                    border.Child = sp;
                    return border;
                }
            }
        }

//add instance of this floating object into worksheet
MyFloatingObject mf = new MyFloatingObject("mf1", 10, 10, 200, 100);
gcSpreadSheet1.ActiveSheet.FloatingObjects.Add(mf);
Public Class MyFloatingObject
    Inherits GrapeCity.Xaml.SpreadSheet.UI.CustomFloatingObject
    Public Sub New(name As String, x As Double, y As Double, width As Double, height As Double)
        MyBase.New(name, x, y, width, height)
    End Sub

    Public Overrides ReadOnly Property Content() As FrameworkElement
        Get
            Dim border As New Border()

            Dim sp As New StackPanel()
            sp.Children.Add(New Button() With { _
                .Content = "Label", _
                                                                .Background = new SolidColorBrush(Windows.UI.Colors.Blue) _
            })
            sp.Children.Add(New Button() With { _
                .Content = "Button", _
                                                                .Background = new SolidColorBrush(Windows.UI.Colors.Red) _
            })

            border.BorderThickness = New Thickness(1)
            border.BorderBrush = New SolidColorBrush(Windows.UI.Colors.Black)
            border.Child = sp
            Return border
        End Get
    End Property
End Class

'add instance of this floating object into worksheet
Dim mf As New MyFloatingObject("mf1", 10, 10, 200, 100)
GcSpreadSheet1.ActiveSheet.FloatingObjects.Add(mf)
Requirements

Target Platforms: Windows Server 2012, Windows RT

See Also

Reference

Worksheet Class
Worksheet Members

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options