Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
Im Using radcombobox with check boxes,

if user clicks Check All inside combobox i want to pass the value like

ifsc.selecteditem="ALL"
how can i do that

thanks in advance...,
Posted

1 solution

Follow this algorithm :

On click event of combo box

IF {Count of all item} = {Count of all selected item}
THEN pass selected value as "ALL"
ELSE pass selected value

Here is the code

string role = string.Empty;
var sb = new StringBuilder();
var collection = cmbifsc.CheckedItems;

IF (collection.count=cmbifsc.Items.Count)
sb.Append("%" + "ALL" + "%,");
ELSE
foreach (var item in collection)
sb.Append("%" + item.Text + "%,");

role = sb.ToString().Substring(0, sb.ToString().Length - 1); role=cmbifsc.selecteditem.text;--this will take selected values..


Hope this helps if yes then accept and vote answer other wise revert back with your queries.
--Rahul Dhoble
 
Share this answer
 
v2
Comments
tpkpradeep 19-Jan-13 7:15am    
can you give me the code....,
below is what im using....,

string role = string.Empty;
var sb = new StringBuilder();
var collection = cmbifsc.CheckedItems;

foreach (var item in collection)
sb.Append("%" + item.Text + "%,");

role = sb.ToString().Substring(0, sb.ToString().Length - 1);
role=cmbifsc.selecteditem.text;--this will take selected values..
how to give the if condition.?
RDBurmon 20-Jan-13 23:56pm    
I have improved my answer above please check out code there. Syntax may be wrong

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900