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

TileList OnNeedDataSource

2 Answers 50 Views
TileList
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 22 Jun 2014, 11:33 PM
I want to use C# classes to query the database and create a data table and then set it as my DataSource for my TileList. However, after some debugging it seems that TileList does not have a "OnNeedDataSource" attribute to run a method that will query the data table. I know that I can set the DataSourceID, but I prefer to do it via C# code. This is what it looks like

<telerik:RadTileList runat="server" ID="PurchaseTileList" Width="900px"
                TileRows="1"
                EnableDragAndDrop="True" 
                SelectionMode="None"
                OnTileDataBound="TileListPurchase_OnDataBound"
                OnNeedDataSource="TileListPurchase_NeedDataSource">
                <DataBindings>
                    <CommonTileBinding TileType="RadTextTile" Shape="Square" DataTitleTextField="ProductDescription" DataNameField="ProductID" />
                    <TilePeekTemplate>
                        <div class="productNamePeek"><%# DataBinder.Eval(Container.DataItem,"PName") %></div>
                    </TilePeekTemplate>
                </DataBindings>
                <Groups>
                    <telerik:TileGroup>
                        <telerik:RadTextTile runat="server" Shape="Square" Font-Size="18px" Font-Bold="true"
                             Text="Products">
                            <Title Text=""></Title>
                        </telerik:RadTextTile>
                    </telerik:TileGroup>
                </Groups>
            </telerik:RadTileList>

My TileListPurchase_NeedDataSource will set Data Source to a created DataTable (This, however, is never run)

and my TileListPurchase_OnDataBound currently doesn't do much seeing as I'm not sure how to set these values for the tile.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Jun 2014, 06:48 AM
Hi Jason,

In order to achieve your scenario please try to bind the RadTileList in the Page_Load event. Please have a look into the following help documentation for further information.

Defining Structure
Supported Datasources

Thanks,
Shinu.
0
Jason
Top achievements
Rank 1
answered on 23 Jun 2014, 04:34 PM
From what I understand, I just set the datasource in page_load instead. That sounds perfect. Thank you.
Tags
TileList
Asked by
Jason
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jason
Top achievements
Rank 1
Share this question
or