复选框内的复选框 [英] Check boxes inside combo box

查看:126
本文介绍了复选框内的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

Im使用带有复选框的radcombobox,



如果用户点击组合框内的全部检查我想传递值喜欢



ifsc.selecteditem =ALL

我该怎么做



提前感谢...,

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...,

推荐答案

遵循此算法:



点击活动组合框



IF {所有项目的计数} = {所有选定项目的计数}

然后将所选值作为全部传递

ELSE传递选定值



这是代码



字符串角色= string.Empty;

var sb = new StringBuilder();

var collection = cmbifsc.CheckedItems;



IF(collection.count = cmbifsc.Items.Count)

sb.Append(%+ALL+% ,);

ELSE

foreach(集合中的var项目)

sb.Append(%+ item.Text +% ,);



role = sb.ToString()。Substring(0,sb.ToString()。Length - 1); role = cmbifsc.selecteditem.text; - 这将采用选定的值..





希望这有帮助,如果是,那么接受并投票回答其他明智的回复你的疑问。

--Rahul Dhoble
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


这篇关于复选框内的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆