RadCheckBoxList unchecked item

4 posts, 0 answers
  1. SSirica
    SSirica avatar
    88 posts
    Member since:
    Jan 2007

    Posted 06 Sep 2017 Link to this post

    When I uncheck an item in my RadCheckBoxList I would like to update something indicating that the use no longer wishes to include this item.  I figured using the SelectedIndexChanged event along with the SelectedItem.value property would be the way to go.  Boy was I wrong.  Works great when you check an item...when you uncheck one you get a big value of nothing. 

     

    How do I get the ID of the item that was just unchecked in a RadCheckBoxList?

  2. Eyup
    Admin
    Eyup avatar
    3860 posts

    Posted 11 Sep 2017 Link to this post

    Hi,

    You can achieve this requirement directly on client-side using the following event handler:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/checkboxlist/client-side-programming/events/onitemcheckedchanged

    I hope this will prove helpful.

    Regards,
    Eyup
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. SSirica
    SSirica avatar
    88 posts
    Member since:
    Jan 2007

    Posted 11 Sep 2017 in reply to Eyup Link to this post

    Client side does me no good.  If I wanted to use javascript I wouldn't have indicated that I was trying to get the info using SelectedIndexChanged.  Thanks anyway.  I ended up using the RadListBox to obtain the desired result.  
  4. Loïc
    Loïc avatar
    27 posts
    Member since:
    Oct 2016

    Posted 12 Sep 2017 Link to this post

    Well, you have different solutions with the RadListBox to obtain your desired result.

    For example, you can use ViewState to create a copy of your RadListBox before any user input. Then, on SelectedIndexChanged method, you compare which value has changed to get the ID of the item that was just unchecked.

    Other example, you can use client-side event (in addition to Eyup link) with Ajax Request to execute server-side method, like SelectedIndexChanged. More information here : http://docs.telerik.com/devtools/aspnet-ajax/controls/ajax/client-side-programming/overview.

    Let me know if you have any questions.

Back to Top