RadPanelBar within Formview

8 posts, 0 answers
  1. Jun
    Jun avatar
    47 posts
    Member since:
    Sep 2006

    Posted 08 Sep 2009 Link to this post

    I am looking for an example where the the radpanelbar items contain bindable controls from the datasource specified within a formview. I made the following layout but binding would not work. The bindable  column1 (in bold) below is not populated. Any better approach in handling a bindable data entry form within a radpanelitem? Please help.


    <formview id="test" runat="server" datasource="onesource">  
     <EditItemTemplate> 
    <telerik:radpanelbar> 
    <items> 
     
     <telerik:RadPanelItem Text="1st bar" Expanded="true" > 
       <Items>                              
            <telerik:RadPanelItem Value="clInfo" > 
            <ItemTemplate> 
                 <asp:TextBox id="txt1st" runat="server" Text'<%# Bind("Column1") %>' 
            <ItemTemplate> 
           </telerik:RadPanelItem> 
    </items> 
    </telerik:RadPanelItem> 

    </items>
    </telerik:radpanelbar> 
     
     </EditItemTemplate> 
     
     <InsertItemTemplate> 
    ....  
    ....  
     </InsertItemTemplate> 
    </formview> 
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Sep 2009 Link to this post

    Hello,

    You can bind the textbox using the Eval method as shown below:
    aspx:
     <telerik:RadPanelItem Value="clInfo" runat="server"
            <ItemTemplate> 
                  <asp:TextBox ID="txt1st" runat="server" Text='<%#DataBinder.Eval(FormView1.DataItem,"Column1")%>'></asp:TextBox> 
            </ItemTemplate> 
     </telerik:RadPanelItem> 

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jun
    Jun avatar
    47 posts
    Member since:
    Sep 2006

    Posted 09 Sep 2009 Link to this post

    Princy,

    It worked. Thanks a lot. Do you have an explanation on why Bind would not work? If you don't have  a time to answer this, that is fine. I really appreciate your prompt response.

    Jun
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Sep 2009 Link to this post

    Hi Jun,

    Go through the following article which gives an overview of Data-Binding Expressions.
    Data-Binding Expressions Overview

    Here is an asp.net forum which explains the difference between DataBinder.Eval and Eval.
    DataBinder.Eval vs Eval

    Thanks
    Shinu
  6. Dan Pettersson
    Dan Pettersson avatar
    20 posts
    Member since:
    Sep 2009

    Posted 12 Mar 2010 Link to this post

    I managed to databind using this technique, however, when listening to the ItemUpdating-event of the formview, e.OldValues and e.NewValues are empty. What should I do?
    My FormView is bound to an ObjectDataSource, so they should be populated.

    /Dan
  7. Kalpana
    Kalpana avatar
    2 posts
    Member since:
    Aug 2012

    Posted 09 Aug 2012 Link to this post

    Hi Dan,
    Iam facing the same issue what you got.Any luck?
    What is the solution for this?

    Telerik team,can you guys help me on this?
    kalpana

  8. Greg
    Greg avatar
    29 posts
    Member since:
    Oct 2007

    Posted 08 Mar 2014 in reply to Princy Link to this post

    Using Eval does not provide two-way binding so your solution is not correct as a replacement for Bind("someProperty"). How do we get back two-way binding in a PanelBarItem inside an EditItemTemplate?
  9. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 12 Mar 2014 Link to this post

    Hello,

    In this case the only workaround would be to implement two-way binding functionality manually. When user updates the data you can access the RadPanelBar control withing the form view and retrieve its text box values  and update the data source manually.

    Regards,
    Boyan Dimitrov
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017