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

RadPanelBar within Formview

7 Answers 112 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Jun
Top achievements
Rank 1
Jun asked on 08 Sep 2009, 09:44 PM
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> 

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Sep 2009, 07:25 AM
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.
0
Jun
Top achievements
Rank 1
answered on 09 Sep 2009, 01:13 PM
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
0
Shinu
Top achievements
Rank 2
answered on 11 Sep 2009, 10:17 AM
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
0
Dan Pettersson
Top achievements
Rank 1
answered on 12 Mar 2010, 04:53 PM
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
0
Kalpana
Top achievements
Rank 1
answered on 09 Aug 2012, 06:43 AM
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

0
Greg
Top achievements
Rank 1
answered on 08 Mar 2014, 07:34 PM
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?
0
Boyan Dimitrov
Telerik team
answered on 12 Mar 2014, 02:20 PM
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.

 
Tags
PanelBar
Asked by
Jun
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jun
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Dan Pettersson
Top achievements
Rank 1
Kalpana
Top achievements
Rank 1
Greg
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or