Listbox losing SelectedItems in CellEditTemplate

2 posts, 1 answers
  1. Nathan
    Nathan avatar
    13 posts
    Member since:
    Jan 2011

    Posted 12 Jan 2011 Link to this post


    I'm trying to create a databound Listbox in a radGridView. I have come across some similar code you posted up on this thread ( which places a Listbox in GridViewDataColumn.CellEditTemplate. Selecting the items are fine. However, once you have finished selecting items in the cell, click anywhere else and then come back to edit the cell, the selected items are not highlighted.

    It looks like the ListBox binds itself to a new instance of its ItemSource everytime you enter the CellEditTemplate. I have tried specifying the ItemSource using xaml but the same thing still happens.

    Any help to make the ListBox.SelectionItems persist would be much appreciated. The code I got from you in the afore mentioned thread can be found here:

    p.s. I was also curious about 2 things in the example
    1. Click on a ListBox item (but not on the checkbox) does not always tick the corrosponding checkbox. This is sporatic.
    2. Are there many differences between the Telerik listbox and the normal windows Listbox? I cant seem to get the example to work with a Telerik listbox.

    Thanks for your help.

  2. Answer
    Maya avatar
    4062 posts

    Posted 13 Jan 2011 Link to this post

    Hello Nathan,

    If you want to keep the selected items, you may expose a collection holding the information for them . You may take a look at this forum thread and this code library that demonstrate a similar approach by using a RadComboBox instead of ListBox. 
    Considering the Telerik ListBox, it is intended only for internal use in RadScheduler. It is not supported and it might change (or even disappear) without notification. 

    Kind regards,
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top