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

Silverlight UserControls as TileViewItem

3 Answers 58 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Vinay
Top achievements
Rank 1
Vinay asked on 30 May 2011, 09:14 AM
How can i add a collection of Silverlight UserControls as TileViewItem.
Please Help me with this. As many of my previous posts have been Ignored.

And Admin please do look into the other posts that i have made. Its very urgent.

3 Answers, 1 is accepted

Sort by
0
Accepted
Zarko
Telerik team
answered on 31 May 2011, 03:43 PM
Hello vinay uthappa,
What exactly do you mean by adding user controls to the RadTileView, because you should be able to add them like any other item with something like this:
for (int i = 0; i < 100; i++)
{
    this.myItems.Add(new MyUserControl());
}
  
this.myTileView.ItemsSource = this.myItems;
For further references could you please examine the attached project and if you have more questions feel free to ask.

Best wishes,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vinay
Top achievements
Rank 1
answered on 02 Jun 2011, 09:25 AM
Hi, 
Thanks for the Reply... I have a collection of UserControls.

I want the collection of UserControls to be Binded onto TileView.
And also i dont want the TileViewItemHeader at all.. Because the Header is already specified in the UserControl.

Here is how i am going now...
Public Sub New()
        Try
            InitializeComponent()
            Dim MedicalIdentityReports As New ReportsLauncher(ReportLauncherElements.WebPartNames.MedicalIdentityRprt)
            Dim ActivityReports As New ReportsLauncher(ReportLauncherElements.WebPartNames.SAMReportActivity)
            'Dim ExceptionReports As New ReportsLauncher(ReportLauncherElements.WebPartNames.ExceptionReports)
            Dim DictionaryReports As New ReportsLauncher(ReportLauncherElements.WebPartNames.DictionaryEditActivity)
            Dim CareTakerReports As New ReportsLauncher(ReportLauncherElements.WebPartNames.Caretaker)
            Dim DialUpREports As New ReportsLauncher(ReportLauncherElements.WebPartNames.DialUpActivity)
 
            RadDragAndDropManager.AddDragQueryHandler(lstControlView, AddressOf OnDragQuery)
            RadDragAndDropManager.AddDragInfoHandler(lstControlView, AddressOf OnDragInfo)
            RadDragAndDropManager.AddDropQueryHandler(lstControlView, AddressOf OnDropQuery)
            RadDragAndDropManager.AddDropInfoHandler(lstControlView, AddressOf OnDropInfo)
            RadDragAndDropManager.AddDropQueryHandler(tileView1, AddressOf OnDropQuery)
            RadDragAndDropManager.AddDropInfoHandler(tileView1, AddressOf OnDropInfo)
 
 
            Dim incidentItemList As New List(Of UserControlProperties) From {
                       New UserControlProperties With {.UserControlCollection = MedicalIdentityReports, .UserControlName = "Medical Identity Reports"},
                       New UserControlProperties With {.UserControlCollection = ActivityReports, .UserControlName = "Activity Reports"},
                       New UserControlProperties With {.UserControlCollection = DictionaryReports, .UserControlName = "Dictionary Edit Reports"},
                       New UserControlProperties With {.UserControlCollection = CareTakerReports, .UserControlName = "CareTaker Reports"},
                       New UserControlProperties With {.UserControlCollection = DialUpREports, .UserControlName = "Dial Up Reports"}
            }
            tileView1.ItemsSource = incidentItemList
            lstControlView.ItemsSource = incidentItemList
            'lstControlView.DisplayMemberPath = "UserControlName"
            'listBox1.ItemsSource = incidentItemList
             
        Catch ex As Exception
            Dim ex1 As String = ex.Message
        End Try
    End Sub
But here tileView1.ItemsSource = incidentItemList does not take the UserControl Collection properly.
And also UserControlProperties is a properties class,
Public Class UserControlProperties
    Public UserControlCollection As UserControl
    Public UserControlName As String
End Class

And here is my XAML Page,
<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="Iatric.SAM.DashBoard.Reports"
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    xmlns:dragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="625">
     
 
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="500"></RowDefinition>
            <RowDefinition Height="200"></RowDefinition>
        </Grid.RowDefinitions>
 
        <telerikNavigation:RadTileView x:Name="tileView1" Grid.Column="0" dragDrop:RadDragAndDropManager.AllowDrop="True">
             
             
        </telerikNavigation:RadTileView>
 
        <ListBox VerticalAlignment="Top" Grid.Column="1" x:Name="lstControlView" BorderBrush="Brown"
                 BorderThickness="1" dragDrop:RadDragAndDropManager.AllowDrag="True" dragDrop:RadDragAndDropManager.AllowDrop="True" Height="103">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock x:Name="txtItemName" Text="{Binding UserControlName}"></TextBlock>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
 
    </Grid>
</UserControl>


 
0
Zarko
Telerik team
answered on 07 Jun 2011, 02:28 PM
Hi vinay uthappa,
What exactly do you mean by " i dont want the TileViewItemHeader at all"? Do want to keep the Maximize/Minimize button and the ability to drag the RadTileViewItems or you want to remove them all? In any case you'll have to update the default RadTileViewItem template to achieve this( in the attached project I've removed the header and left the Maximize/Minimize button and the drag and drop ability, you can remove them by deleting the StackPanel which is in the Border with name "outerContainer").
And also what exactly do you mean by "does not take the UserControl Collection properly" ? Is the collection wrong or there's something wron with the display of it?
Could you please examine the attached project and see if it helps you and if have more questions feel free to ask.

Best wishes,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TileView
Asked by
Vinay
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Vinay
Top achievements
Rank 1
Share this question
or