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

Clicking outside a check box clears all other selected check boxes

2 Answers 198 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amy
Top achievements
Rank 1
Amy asked on 15 Feb 2011, 08:31 PM
Hi!

I have an issue that I can not seem to find a solution for in the forum. When using the grid and select 7 out of 10 check boxes if I happen to click anywhere on a row outside the check box then all 7 selections deselect. How can I change this functionality so that any previously selected check boxes stay enabled?

I'm using Visual Studio 2010 with the Telerik ASP.NET AJAX (v.2010.3.1215.35) controls.

I have followed the example provided in the forum post cancel OnRowSelecting when clicked outside clientselect checkbox

The logic works in that I can only enable a check box by clicking directly in the check box and not any where else in the row.  However, when I try to get a count of the selected items I always get a value of 0.  In the code behind here is how I'm trying to get a count when the user clicks a 'submit' button...
If (RadGrid1.SelectedItems.Count > 0) Then
    For Each item As GridDataItem In RadGrid1.SelectedItems
        selectedWriters.Add(item("UserID").Text)
    Next
Else
    lErrorMsg.Text = "You must select at least on Writer."
    Return
End If

Could someone please provide some insight as to why I am unable to get a count, or if there is a better/different solution I should try?
Thank you!!

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Feb 2011, 07:05 AM
Hello,


Since Q3 2009 SP1 (version 2009.3.1208) this functionality is built-in for RadGrid for ASP.NET AJAX. You can set the UseClientSelectColumnOnly property in the ClientSettings-Selecting section to true to achieve it. 

Thanks,
Princy.
0
Amy
Top achievements
Rank 1
answered on 16 Feb 2011, 02:34 PM
Thank you so much, that worked perfect!!  :-)
Tags
Grid
Asked by
Amy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Amy
Top achievements
Rank 1
Share this question
or