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

Rad Combo box with Rad Tree view

0 Answers 56 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
mani
Top achievements
Rank 1
mani asked on 30 Sep 2009, 01:18 PM
Hi
          I used the user control, the user control functions like combo box with rad tree view. this user control i used so many pages. I used the sessions for selected rad tree view selected nodes for searching or inserting values. it is working fine.When i select(node rad tree view) and search. the result found.  when i move to another page search by default this session value search result is showing. Herewith i cannot clear the session value after search because the need data source asking session value for  Edit and retrieval purpose. Let me how can i solved this problem..

Herewith i send some sample coding


Ascx User Cotnrol Sample Codings

 <telerik:RadAjaxPanel ID="ajaxPnlcmbUniversalSearchDestination" runat="server">
 <telerik:RadComboBox  CausesValidation="false" ID="cmbUniversalSearchDestination"   Text="Destination" EmptyMessage="Destination"
OnItemsRequested="cmbUniversalSearchDestination_OnItemsRequested"
   runat="server"  Width="98%" Font-Size="Small" TabIndex="11">
   <ItemTemplate>                           
   <div class="cmbareadiv">                                    
  <div style="overflow: auto">
 <asp:LinkButton ID="btnDestinationSelect" CausesValidation="false"  OnClick="lnkDestinationSelect_Click" CssClass="footsize"   Text="Select" runat="server"></asp:LinkButton>                                                                                                                                                                                                                                               
<asp:LinkButton ID="btnDestinationClear" CausesValidation="false"  OnClick="btnDestinationClear_Click" CssClass="footsizeclose"   Text="Clear" runat="server"></asp:LinkButton>                                                                                                             
 </div></div>    
<telerik:RadTreeView runat="server" ID="treeDestination"    PersistLoadOnDemandNodes="true"   Skin="Web20" CheckBoxes="true" MultipleSelect="true">                                             
</telerik:RadTreeView>   
 </ItemTemplate>  
<Items>  
 <telerik:RadComboBoxItem Text="" />  
   </Items>  
<CollapseAnimation Duration="200" Type="OutQuint" />
  </telerik:RadComboBox>
 </telerik:RadAjaxPanel>

ascx User control Code behind




        //Load SubArea Details in DropDown
        public void LoadSubAreaFromDB()
        {

            IList<AreaData> subAreaData = new List<AreaData>();
            ArrayList AreaIdList = new ArrayList();
            List<long> destinationlist = new List<long>();
            RadTreeView treedestination = (RadTreeView)cmbUniversalSearchDestination.Items[0].FindControl("treeDestination");
            // treedestination.ClearCheckedNodes();
            destinationlist.Clear();
            foreach (RadTreeNode node in treedestination.Nodes)
            {

                if (node.Checked)
                {
                    destinationlist.Add(Convert.ToInt32(node.Value));
                    long destinationnode = (Convert.ToInt32(node.Value));
                    AreaIdList.Add(destinationnode);
                    Destinationvalues += node.Text + ",";
                    
                }
            }

            JSSessionHandler.SetSessionValue("AreaIdList", AreaIdList);
}}



Aspx Page Calling this function

 
        //Load Area Reference Data From Page
        public AreaAssociationData LoadAreaReferenceDataFromPage()
        {

            UserData sessionUser = (UserData)JSSessionHandler.GetSessionValue("UserData");
            AreaAssociationData aAreaAssociationData = new AreaAssociationData();
            if (sessionUser != null && sessionUser.Id > 0)
            {

                if ((ArrayList)JSSessionHandler.GetSessionValue("AreaIdList") != null)
                {
                    List<AreaData> AssociatedDestinations = new List<AreaData>();
                    List<AreaData> AssociatedSubAreas = new List<AreaData>();
                    List<AreaData> AssociatedLocations = new List<AreaData>();

                    ArrayList DestinationList = new ArrayList();
                    DestinationList = (ArrayList)JSSessionHandler.GetSessionValue("AreaIdList");

                    if (DestinationList != null)
                    {
                        foreach (long DestinationId in DestinationList)
                        {
                            AreaData aDestination = new AreaData();
                            aDestination.Id = DestinationId;
                            AssociatedDestinations.Add(aDestination);

                        }
                    }
                 

                    aAreaAssociationData.DestinationCollection = AssociatedDestinations;
                   
            }
            else
            {
                Server.Transfer("~/Default.aspx");
            }
            return aAreaAssociationData;
        }



  if ((txtUniversalSearchFirstName.Text == string.Empty) && (txtUniversalSearchLastName.Text == string.Empty) && (txtUniversalSearchEmail.Text == string.Empty) && (txtUniversalSearchPostalZipCode.Text == string.Empty) && (JSSessionHandler.GetSessionValue("AreaIdList") == null) && (JSSessionHandler.GetSessionValue("SessioncontactTypelist") == null) && txtContactCode.Text == string.Empty)
            {
                LblSearchMsg.Visible = true;
            }

            else
            {

 SearchContacts();

   }

}



No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
mani
Top achievements
Rank 1
Share this question
or