RadComboBox to populate within RadPanelBar

6 posts, 1 answers
  1. Wendy Hunt
    Wendy Hunt avatar
    50 posts
    Member since:
    Nov 2009

    Posted 23 Dec 2009 Link to this post

    I have a ComboBox within the PanelBar.  I can populate the ComboBox with a page load call that is located outside the panelbar, but within the bar, I'm not sure how to get the ComboBox to update.  A co-worker suggested adding a RadAjaxManager piece that didn't work either.  Here is what I have so far:
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" style="z-index:1; position:absolute; top:2500px;left:10px;">  
          <telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="SingleExpandedItem" Width="740px">  
                <telerik:RadPanelItem Expanded="True" Text="Step 1: Test" runat="server" Selected="true">   
                        <telerik:RadPanelItem Value="AccountInformation" runat="server">  
                                <div style="background-color: #edf9fe">  
            <asp:Label ID="Label12" runat="server" Text="Project Search" style="width: 137px; font-weight: 700;"></asp:Label><br /> 
            <asp:Label ID="Label9" runat="server" Text="Project Name:" style="width: 113px; text-align: right;"></asp:Label><br /> 
            <telerik:RadComboBox ID="projectNameRadComboBox" runat="server" AutoPostBack="true"  ZIndex="99999" Width="250px"></telerik:RadComboBox><br /> 
            <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" > 
                        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                                    <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" /> 
                                    <telerik:AjaxUpdatedControl ControlID="projectNameRadComboBox" /> 
            <asp:Label ID="Label2" runat="server" Text="Identifier:"></asp:Label><br /> 
            <asp:TextBox ID="identifierTextBox" runat="server" Width="250px"></asp:TextBox><br /> 
            <asp:Label ID="Label13" runat="server" Text="Project Group:" style="text-align: right;"></asp:Label><br /> 
            <telerik:RadComboBox ID="projectGroupRadComboBox" runat="server"  ZIndex="99999" Width="250px"></telerik:RadComboBox><br /> 
            <asp:Button ID="projectSearchButton" runat="server" Text="Search" SkinID="smallGreenButton" Width="50px" onclick="projectSearchButton_Click" /><br /> 
                                    <br /> 
                                    <br /> 
                                    <br /> 

    This is my code behind piece that works for populating outside of the PanelBar:
            IQueryable allProjectName = Project.GetAllBindings();  
            this.projectNameRadComboBox.DataSource = allProjectName;  
            this.projectNameRadComboBox.DataValueField = "ID";  
            this.projectNameRadComboBox.DataTextField = "Name";  
            this.projectNameRadComboBox.Filter = RadComboBoxFilter.Contains;  

    I want to understand how the ajax is going to make a call from within the PanelBar for the ComboBox.  Thanks!

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

    Posted 23 Dec 2009 Link to this post

    Hi Wendy,

    Access the PanelBar item where the RadComboBox is placed and get reference to combo using the FindControl() method as shown below.

        protected void Page_Load(object sender, EventArgs e) 
            RadPanelItem item = (RadPanelItem)RadPanelBar1.FindItemByValue("AccountInformation"); 
            RadComboBox combo = (RadComboBox)item.FindControl("projectNameRadComboBox"); 
            // Popupate the combo 
            combo.Items.Add(new RadComboBoxItem("New")); 

  3. Wendy Hunt
    Wendy Hunt avatar
    50 posts
    Member since:
    Nov 2009

    Posted 24 Dec 2009 Link to this post

    Hi Shinu -

    It worked... thank you so much!!

    RadPanelItem AccountInformationItem = (RadPanelItem)RadPanelBar1.FindItemByValue("AccountInformation");  
            RadComboBox projectNameRadComboBox = (RadComboBox)AccountInformationItem.FindControl("projectNameRadComboBox");  
            IQueryable allProjectName = Project.GetAllBindings();  
            projectNameRadComboBox.DataSource = allProjectName;  
            projectNameRadComboBox.DataValueField = "ID";  
            projectNameRadComboBox.DataTextField = "Name";  
            projectNameRadComboBox.Filter = RadComboBoxFilter.Contains; 

  4. Daniel
    Daniel avatar
    7 posts
    Member since:
    Jul 2010

    Posted 01 Oct 2010 Link to this post

    Hello Friend

    I am looking for a solution about my trouble with the radgrid+ radpanelbar, and I didn't find yet. 
    When I click on buttongrid to add a new item ("InitInsert") my rad grid disappears ! I create some events on radpanelbar_Itemdatabound:
    Protected Sub rpbConcorrencia_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadPanelBarEventArgs)
            Dim item As RadPanelItem = DirectCast(e.Item, RadPanelItem)
            Dim level As Integer = item.Level
            If level = 1 Then
                Dim rdgAnaliseConcorrencia As RadGrid = DirectCast(CType(e.Item.FindControl("rdgAnaliseConcorrencia"), RadGrid), RadGrid)

                AddHandler rdgAnaliseConcorrencia.InsertCommand, AddressOf rdgAnaliseConcorrencia_InsertCommand
                AddHandler rdgAnaliseConcorrencia.DeleteCommand, AddressOf rdgAnaliseConcorrencia_DeleteCommand
                AddHandler rdgAnaliseConcorrencia.NeedDataSource, AddressOf rdgAnaliseConcorrencia_NeedDataSource
                AddHandler rdgAnaliseConcorrencia.UpdateCommand, AddressOf rdgAnaliseConcorrencia_UpdateCommand
                AddHandler rdgAnaliseConcorrencia.ItemCommand, AddressOf rdgAnaliseConcorrencia_ItemCommand
                AddHandler rdgAnaliseConcorrencia.ItemDataBound, AddressOf rdgAnaliseConcorrencia_ItemDataBound


            End If
        End Sub

    I am using a radajaxpanel too !

    Could you help me in this case ?? (Sorry for my poor English)
  5. Iana Tsolova
    Iana Tsolova avatar
    3388 posts

    Posted 06 Oct 2010 Link to this post

    Hello Daniel,

    The described issue can appear in can the grid is not bound properly. Could you please confirm that the code for binding the grid is only the one available in the NeedDataSource event handler where you just need to set the RadGrid DataSource property, and this property is not set elsewhere nor the DataBind() method is called for the grid? If that is true, then try attaching the event handlers on ItemCreated of the RadPanelBar instead of on ItemDataBound and see if it makes any difference.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Daniel
    Daniel avatar
    7 posts
    Member since:
    Jul 2010

    Posted 06 Oct 2010 Link to this post

    Hey Iana

    Thanks for replay !! But I got solve this matter ont his weekend !!

    As I create the event handler on databind of Panelbar, it was necessary to create on Aspx : OnUpdateCommand ="rdgAnaliseConcorrencia_UpdateCommand" for each event handler ! I don't know VB very well, so I didn't Know how these events behave !!

    Once more, thanks for help !! (Sorry again for my poor English)
Back to Top