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

RadComboBox causes memory leak in WPF

0 Answers 45 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 26 Jun 2012, 09:10 AM
I have used RadComboBoxes inside a Grid in my WPF application as shown below.
<tk:RadComboBox Grid.Row="3" Grid.Column="3" Style="{StaticResource DropDown}" x:Name="cmbColor" Height="25" Margin="5,5,5,5" DropDownOpened="cmbColor_DropDownOpened"
IsEditable="False" SelectedValue="{Binding PR_COLOR}" MaxWidth="250"
ItemTemplate="{StaticResource DropDownCodeMeaning}"  />



I am binding the data to the combo box when the user clicked on the combo box to select an item from it.
I have used the  event "DropDownOpened" to bind data to this combo box.

Below shown is the code behind.

// set the dropdown list for a combobox to all entities for a business object
  private void SetDropDown<BusObj, BusEntity>(RadComboBox cmb, ref BusObj busobj)
      where BusObj : BusinessObject<BusEntity>, new()
      where BusEntity : BusinessEntity, new()
  {
      if (busobj == null)
      {
          busobj = new BusObj();
      }
      if (cmb.ItemsSource == null)
      {
          var RecordList = busobj.GetAllEntities();
          if (RecordList.Count > 0)
              RecordList.ApplySort("SortKey", ListSortDirection.Ascending);
          cmb.ItemsSource = RecordList;
 
      }
  }

After sets the Items Source for the combo box, the memory increases rapidly. Anyone knows why this happens?
Please help me. I am using the telerik version 2010.1.603.35.

Thanks in advance,
Rajesh V R

No answers yet. Maybe you can help?

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