Prolly a daft question

3 posts, 1 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 19 May 2009 Link to this post

    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. Answer
    Simon
    Admin
    Simon avatar
    2281 posts

    Posted 22 May 2009 Link to this post

    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.
  3. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 22 May 2009 Link to this post

    Simon,

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

    Nice one.

    --
    Stuart
Back to Top