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

RadPanelBar DataBinding Q2 2010 SP2

3 Answers 130 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
kavitha
Top achievements
Rank 1
kavitha asked on 21 Apr 2011, 10:19 PM
Hello,

  I am on Q2 2010 SP2. I have a rad panel declared like this.

<telerik:RadPanelBar runat="server" ID="RadPanelBar1" Width="100%" Visible="true" EnableViewState="true">
  <Items>
    <telerik:RadPanelItem Expanded="true" Text="Transfer1" runat="server" Selected="true" PreventCollapse="true" style="font-size:10pt;font-weight:bold">
      <Items>
        <telerik:RadPanelItem Value="Transfer2" runat="server" Width="100%">
         <ItemTemplate>
          <div style="background-color: #edf9fe">      
            <table width="100%">
                <tr><td width="15%"><b>Order Number : </b></td><td align="left" width="40%"><b><asp:Label ID="lblOrderNumber" runat="server" Text='<%#Bind("OrderNumber")%>'></asp:Label></b></td><td>Customer ID:</td><td align="left"><asp:Label ID="lblCustomerID" runat="server" Text='<%# Bind("CustomerID")%>'></asp:Label></td></tr>               
            </table>
    </div>
   </ItemTemplate>
  </telerik:RadPanelItem>
 </Items>
</telerik:RadPanelItem>
        </Items>
 </telerik:RadPanelBar>  


Is it possible to Bind the "Transfer2" RadPanelItem to a Datatable  and have the ORderNumber and CustomerID fields set from the first row in the Datatable?

Thanks,
Kavitha

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 22 Apr 2011, 02:55 PM
Hi Kavitha,

You need to bind the PanelBar, not only the PanelItem.

Here is a nice article on templates in RadPanelBar: http://www.telerik.com/help/aspnet-ajax/panelbar-templates-overview.html

Also, you can check an alternative way of binding expressions which are getting values of items properties (in the example from the RadPanelItem.Value property) here: http://www.telerik.com/help/aspnet-ajax/panelbar-templates-binding.html


Regards,
Nikolay Tsenkov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
kavitha
Top achievements
Rank 1
answered on 25 Apr 2011, 09:19 PM
This is using Static binding, Could you give an example to bind the RadPanelBar to a DataTable and bind controls withing RadPanelItem to columns in the DataTable. I can't seem to get this to work.

Thanks,
0
Shinu
Top achievements
Rank 2
answered on 26 Apr 2011, 08:44 AM
Hello Kavitha,

RadPanelBar fully supports binding to a wide range of datasources:

  • DataSet.
  • DataTable.
  • DataView.

Take look at the following demo and help article.
Hierarchical Data Binding
Binding to DataSet, DataTable, and DataView

Thanks,
Shinu.
Tags
PanelBar
Asked by
kavitha
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
kavitha
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or