Rename Listbox Item client-side

4 posts, 0 answers
  1. Roby Kaufman
    Roby Kaufman avatar
    5 posts
    Member since:
    Oct 2007

    Posted 10 Dec 2009 Link to this post

    Version: RadControls for ASP.NET AJAX 2009 Q3 (1208)

    I have been unable to refresh a listbox after renaming an item using the following code.  I have also attempted using the listbox track/commit functions pre/post rename to no avail.

    var listbox = $find("<%= MyListBox.ClientID %>");         
    var selectedItem = listbox.get_selectedItem();  
    if (selectedItem) {  
     selectedItem.set_text("New Name");  
     listbox.repaint();  

    Please suggest the correct method for renaming a listbox item so that it may be visible to the end user.

    Thanks,
    Karlin
  2. Yana
    Admin
    Yana avatar
    4896 posts

    Posted 11 Dec 2009 Link to this post

    Hi Karlin,

    I've tested this code and it worked at our side. Could you please open a support ticket and send us a simple page illustrating the problem. Thanks


    Kind regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Roby Kaufman
    Roby Kaufman avatar
    5 posts
    Member since:
    Oct 2007

    Posted 11 Dec 2009 Link to this post

    Ok, I've submitted a support ticket.  I need to further clarify my situation.  I am unable to rename an item that has been moved from another listbox via the listbox to listbox transfer functionality.
  4. Roby Kaufman
    Roby Kaufman avatar
    5 posts
    Member since:
    Oct 2007

    Posted 14 Dec 2009 Link to this post

    If anyone else is having the same issue, here is the current workaround from Telerik support:

    if (selectedItem) {  
                    selectedItem._textElement =   
                        $telerik.$(selectedItem.get_element()).children("span")[0];  
                    selectedItem.set_text('new text');  
                }  
     

    I'm told this should be fixed in the next release.
Back to Top