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

RadCheckBoxList unchecked item

3 Answers 272 Views
CheckBox
This is a migrated thread and some comments may be shown as answers.
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
SSirica asked on 06 Sep 2017, 06:34 PM

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?

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 11 Sep 2017, 12:23 PM
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.
0
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
answered on 11 Sep 2017, 03:02 PM
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.  
0
Loïc
Top achievements
Rank 1
answered on 12 Sep 2017, 10:03 AM

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.

Tags
CheckBox
Asked by
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Eyup
Telerik team
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
Loïc
Top achievements
Rank 1
Share this question
or