4 Answers, 1 is accepted

Please have a look into the following code snippet to achieve your scenario.
ASPX:
<
telerik:RadListBox
runat
=
"server"
ID
=
"RadListBox1"
CheckBoxes
=
"true"
Height
=
"200px"
Width
=
"230px"
>
<
Items
>
<
telerik:RadListBoxItem
Text
=
"Item1"
runat
=
"server"
/>
<
telerik:RadListBoxItem
Text
=
"Item2"
runat
=
"server"
/>
<
telerik:RadListBoxItem
Text
=
"Item3"
runat
=
"server"
/>
<
telerik:RadListBoxItem
Text
=
"Item4"
runat
=
"server"
/>
</
Items
>
</
telerik:RadListBox
>
<
asp:CustomValidator
ID
=
"CustomValidator2"
runat
=
"server"
ClientValidationFunction
=
"ValidationCriteria"
ErrorMessage
=
"CustomValidator"
>
</
asp:CustomValidator
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Validate"
AutoPostBack
=
"false"
>
</
telerik:RadButton
>
JavaScript:
<script type=
"text/javascript"
>
function
ValidationCriteria(source, args) {
var
listbox = $find(
'<%= RadListBox1.ClientID %>'
);
if
(listbox.get_checkedItems().length == listbox.get_items().get_count())
args.IsValid =
true
;
else
args.IsValid =
false
;
}
</script>
Thanks,
Shinu.
Hello Rahul,
Thank you for contacting us.
To assist you the most efficient way in resolving the issue that you are currently experiencing, can you please provide me with a very simplified runnable project that I can test from my side and observe the issue that you have? Can you also explain in more details the exact issue - what is the current behavior, what is the expected one, under which browsers is reproducible?
We will be waiting for your reply.
Regards,Aneliya Petkova
Telerik

<telerik:RadListView runat="server" ID="RadListView1" onitemdatabound="RadListView1_ItemDataBound" BorderColor="White" BorderStyle="None"> <ClientSettings></ClientSettings> <ItemTemplate> <div> <table> <tr> <td class="LabelWidth"> <asp:Label ID="Label4" runat="server" Text='<%# (DataBinder.Eval(Container.DataItem,"PermissionItemName")) %>'></asp:Label> </td> <td> <asp:CheckBoxList RepeatDirection="Horizontal" CssClass="horizontalListbox" ID="Listbox_Permission" runat="server" S> </asp:CheckBoxList> <%--DataTextField="PermissionOperationName"--%> </td> </tr> </table> </div> </ItemTemplate> </telerik:RadListView> <telerik:RadListBox ID="qw" runat="server" CheckBoxes="True" BorderColor="White" BorderStyle="None" DataValueField="PermissionItemOpearationId" DataTextField="PermissionOperationName" BorderWidth="0" AutoPostBack="false" CssClass="horizontalListbox" CausesValidation="false" ></telerik:RadListBox> <asp:CustomValidator ID="custm_vldator_role" runat="server" ClientValidationFunction="ValidateRadlistbox" ErrorMessage="Should select atleast One" ForeColor="Red" >*</asp:CustomValidator><asp:Button ID="btn_new" CssClass="btn btn-sm btn-success" runat="server" Text="Submit" onclick="btn_new_Click" ValidationGroup="role" />
Hi Rahul,
Unfortunately without being able to test the actual project locally, It is indeed very hard to determine what might be causing the issue (you have not send us your exact code – “ValidateRadlistbox”, “btn_new_Click”, “RadListView1_ItemDataBound” functions). However, I have tried to modify your .aspx, but I am currently not able to replicate the issue from my side.
Did you review the code snippet provided by Shinu? Does it work at your side?
Could you please send us your exact functions or modify the Shinu's code so we can see the problem locally and assist you in most efficient way in resolving the issue.
Aneliya Petkova
Telerik