This is a migrated thread and some comments may be shown as answers.

Accessing RadTileView1.ItemsSource members from within Custom Control

1 Answer 26 Views
TileView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 16 Nov 2010, 09:05 AM
as follows:
            // Apply Data Source to Tile View
            this.tileView1.ItemsSource = new TagBoards();
---------------------------------------
        <telerik:RadTileView x:Name="tileView1" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Top" Margin="9,40,0,0">
            <telerik:RadTileView.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Name}" />
                </DataTemplate>
--------------------------------------
Works fine. But how to I access other fields from ItemSource within Custom Control:
-----------------------------------------
            <telerik:RadTileView.ContentTemplate>
                <DataTemplate>
                    <telerik:RadFluidContentControl Name="MineViewFluidControl" SmallToNormalThreshold="250, 150"
        NormalToSmallThreshold="250, 150" NormalToLargeThreshold="425, 350"
        LargeToNormalThreshold="425, 350">
                            <telerik:RadFluidContentControl.SmallContent>
                            <my:ZoneMinimum x:Name="MinimumZoneSmall" AlarmNameText="{Binding AlarmNameText}"/>
                        </telerik:RadFluidContentControl.SmallContent>
----------------------------------------------------

    /// </summary>
    public partial class ZoneMinimum : UserControl
    {
        public ZoneMinimum()
        {
            InitializeComponent();
        }

        public string ZoneLabelText
        {

            get { return tblkZoneName.Text; }

            set { tblkZoneName.Text = value; }

        }

        public string ItemLabelText
        {

            get { return tblkItemName.Text; }

            set { tblkItemName.Text = value; }

        }

        public string AlarmNameText
        {

            get { return tblkAlarmName.Text; }

            set { tblkAlarmName.Text = value; }

        }

        public string TruckTotalText
        {

            get { return tblkTruckTotal.Text; }

            set { tblkTruckTotal.Text = value; }

        }

        public string AlarmTotalText
        {

            get { return tblkAlarmTotal.Text; }

            set { tblkAlarmTotal.Text = value; }

        }
    }

-------------------------------------------------------------

No go something about dependancy objects???

A 'Binding' cannot be set on the 'AlarmNameText' property of type 'ZoneMinimum'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.

1 Answer, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 17 Nov 2010, 02:15 AM
It apears that the Binding is inherited by the Custom Control, therefore {Binding XXXX} works at Custom Control level :-) E.g. no need for attached fields etc.
Tags
TileView
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Share this question
or