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

Prolly a daft question

2 Answers 44 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 19 May 2009, 11:56 AM
I have a user control, say MyControl.ascx that includes on it a PanelBar.

I want the developer to be able to assign an event handler for the PanelBar's ItemDataBound event.

ATM, they are having to do this programmatically saying something like this...
protected void Page_Load(object sender, EventArgs e) 
  // Load the control, then 
  MyControl.PanelBar.ItemDataBound += ...             
I'd like 'em to be able to do it declaritively....
<uc1:MyControl runat="server" ID="MyControl" OnPanelBarItemDataBound="..." /> 
Is this even possible?

--
Stuart

2 Answers, 1 is accepted

Sort by
0
Accepted
Simon
Telerik team
answered on 22 May 2009, 08:27 AM
Hello Stuart Hemming,

You could expose the RadPanelBar.ItemDataBound event as a property of the UserControl as shown below:

public event RadPanelBarEventHandler PanelBarItemDataBound 
    add 
    { 
        RadPanelBar1.ItemDataBound += value; 
    } 
    remove 
    { 
        RadPanelBar1.ItemDataBound -= value; 
    } 


Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Stuart Hemming
Top achievements
Rank 2
answered on 22 May 2009, 02:20 PM
Simon,

That's really neat; I didn't know you could do that.

Nice one.

--
Stuart
Tags
PanelBar
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Simon
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or