Populating RadPanelBar with data and set RadPanelItem enable property dynamically

5 posts, 1 answers
  1. usr9999
    usr9999 avatar
    41 posts
    Member since:
    Jun 2010

    Posted 08 Jul 2010 Link to this post

    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

  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Jul 2010 Link to this post

    Hello,

    You can perform this in ItemDataBound event of RadPanelBar.

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


    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. usr9999
    usr9999 avatar
    41 posts
    Member since:
    Jun 2010

    Posted 09 Jul 2010 Link to this post

    Thank you. It works.
  5. kavitha
    kavitha avatar
    17 posts
    Member since:
    Oct 2010

    Posted 21 Apr 2011 Link to this post

    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
  6. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 22 Apr 2011 Link to this post

    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.

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