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

Populating RadPanelBar with data and set RadPanelItem enable property dynamically

4 Answers 202 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
usr9999
Top achievements
Rank 1
usr9999 asked on 08 Jul 2010, 05:01 PM

I am populating RadPanelBar from the database. The following is my code.  I have a db column that specifies enable true or false. I would like to set the RadPanelItem enable property using this. How can I do this?

 


Dim
dt As New DataTable

dt =GetPanelItems(Id) – proc to call oracle

Dim links As New DataSet()

 

        links.Tables.Add(dt)

        RadPanelBar1.DataTextField = "panel_name"

        RadPanelBar1.DataNavigateUrlField = ""

        RadPanelBar1.DataFieldID = "panel_id"

        RadPanelBar1.DataFieldParentID = "Parent_panel_Id"

        RadPanelBar1.DataValueField = "panel_value"

        RadPanelBar1.DataSource = links

        RadPanelBar1.DataBind()
Thanks

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 09 Jul 2010, 06:57 AM
Hello,

You can perform this in ItemDataBound event of RadPanelBar.

I hope this documentation is enough for you in accomplishing this.
ItemDataBound


-Shinu.
0
usr9999
Top achievements
Rank 1
answered on 09 Jul 2010, 01:33 PM
Thank you. It works.
0
kavitha
Top achievements
Rank 1
answered on 21 Apr 2011, 10:16 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
0
Nikolay Tsenkov
Telerik team
answered on 22 Apr 2011, 02:54 PM
Hello 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.

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