RadPanelBar inside DataBoundFormView loses RadTextBox binding

3 posts, 0 answers
  1. John Spinney
    John Spinney avatar
    5 posts
    Member since:
    May 2010

    Posted 20 Aug 2010 Link to this post

    I have a bound FormView that contained a series of controls including a bound RadTextBox.  For usability I placed a RadPanelBar inside the FormView and within the ItemTemplate moved the textBox.  The binding no longer is respected.  Should the binding have been preserved or what steps must be done to re-establish the binding?
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 23 Aug 2010 Link to this post

    I don't think that will work since the RadTextBox is now inside of  a different container, RadPanelBar, which is not bound to the data the FormView is. So I don't think it's possible to do that.
  3. Kalina
    Kalina avatar
    918 posts

    Posted 24 Aug 2010 Link to this post

    Hi John,

    Indeed you cannot use declarative databinding in the scenario that you describe.

    However you can handle the FormView.DataBound event, find the RadPanelBar within the ItemTemplate, and use the FindItemByValue PanelBar method to find the exact item. Then obtain the RadTextBox control instance and set the text explicitly:
    protected void FormView1_DataBound(object sender, EventArgs e)
        if (FormView1.CurrentMode == FormViewMode.ReadOnly)
            DataRowView itemData = (DataRowView)FormView1.DataItem;

            RadPanelBar RadPanelBar1 =

            RadPanelItem panelItem1 =

            RadTextBox RadTextBoxProductName =

            RadTextBoxProductName.Text = itemData["ProductName"].ToString();

    Please find more details at the sample page attached.

    All the best,
    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
Back to Top