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

DataBinding and Templated Controls

2 Answers 60 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Gene
Top achievements
Rank 1
Gene asked on 27 May 2009, 07:25 PM
I have a PanelBar that has many controls embedded into the templates.  I'm having trouble getting to the databound events of the templated controls.

As an example, I have the following Panel Bar item with a treeview that has an onNodeDataBoundEvent
<telerik:RadPanelBar ID="RadPanelBar1" runat="server">  
    <Items> 
        <telerik:RadPanelItem runat="server" Text="OUTPUT COLUMNS">  
            <Items> 
                <telerik:RadPanelItem Value="OutputColumns" runat="server">  
                    <ItemTemplate> 
                        <telerik:RadTreeView ID="OutputColumnsRadTreeView" runat="server" CheckBoxes="True" 
                            Height="280px" TriStateCheckBoxes="True" CheckChildNodes="True" Skin="Vista" OnNodeDataBound="OutputColumnsRadTreeView_NodeDataBound">  
                        </telerik:RadTreeView> 
                    </ItemTemplate> 
                </telerik:RadPanelItem> 
            </Items> 
        </telerik:RadPanelItem> 
    </Items> 
</telerik:RadPanelBar> 

However, when I bind:
 protected void Page_Load(object sender, EventArgs e)  
 {  
        RadTreeView OutputColumnsRadTreeView = (RadTreeView)QueryPanelBar.FindItemByValue("OutputColumns").FindControl("OutputColumnsRadTreeView")  
 
        OutputColumnsRadTreeView.LoadContentFile("~/App_Data/QueryOutputColumns.xml");  
        OutputColumnsRadTreeView.DataBind();  

The event is never fired:
protected void SortColumnsRadTreeView_NodeDataBound(object sender, RadTreeNodeEventArgs e)  
{  
        //do something here  

thanks in advance.
Gene.

2 Answers, 1 is accepted

Sort by
0
Gene
Top achievements
Rank 1
answered on 29 May 2009, 04:34 PM
I figured out it wasn't the Templated control that was the problem.  It was that I'm loading xml instead of setting the datasource.
0
Yana
Telerik team
answered on 01 Jun 2009, 08:13 AM
Hello Gene,

I'm glad that you could find the solution.  If you have any other difficulties or questions, please write to us again. 

Best wishes,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
PanelBar
Asked by
Gene
Top achievements
Rank 1
Answers by
Gene
Top achievements
Rank 1
Yana
Telerik team
Share this question
or