Item是DropDownList里面的Item.
ck就是checkboxItem1  后面 跟着一组checkbox   
Item2  后面也跟着一组checkbox...
.............Item      ck1 ck2 ck3 ck4
怎么样才能实现这种效果呢?不知道我表达清楚了没有,还请高手帮个忙。谢谢。

解决方案 »

  1.   

    变通一下,用GridView + checkbox 动态隐藏显示GridView 就得了.
      

  2.   

    To 1L :  可是那是一个下拉列表啊... 用GrivView在选择的时候,不就要全都显示出来了?
      

  3.   

    dropdownlist里实现起来比较困难,至少我不会,div模拟了。
      

  4.   

    无法直接做到,可以用Html+Css模拟这样的效果
      

  5.   

    帮你模拟了一个........<html>
      <head>
        <meta http-equiv="content-type" content="text/tml;charset=gb2312" />
        <title>Div模拟select的option</title>
        <style type="text/css">
          body{font-size:12pt}
        </style>
        <script type="text/javascript">
        function ShowDiv()
        {
          var divS=document.getElementById("divSelect");      
          if(divS.style.display=="none")
          {
            var item=divS.getElementsByTagName("div");
            var divCT=document.getElementById("divCT");
            for(var i=0;i<item.length;i++)
            {
               if(item[i].innerHTML==divCT.innerHTML)
               {
                  item[i].style.backgroundColor='#082569';
                  item[i].style.color='white';
               }                        
            }
            divS.style.display="";
          }
          else
            divS.style.display="none";      
        }
        function SetSpan(Html,e)
        {
          e=e||event;
          var tag=e.srcElement?e.srcElement:e.target;
          if(tag.type!="checkbox")
          {
            document.getElementById("divCT").innerHTML=Html;
            document.getElementById("divSelect").style.display="none";
          }
        }
        document.onclick=function(e)
        {
          e=e||event;
          var tag=e.srcElement?e.srcElement:e.target;
          if(tag.tagName=="BODY")
            document.getElementById("divSelect").style.display="none";
        }
        </script>
      </head>
      <body>
        <div id="divCT" style="position:absolute;left:100px;top:100px;width:300px;height:21px; border:solid 1px black; 
        border-bottom-width:1px; border-bottom-color:#cccccc;border-bottom-style:solid; margin:0px">请选择......</div>
        <!-----下面这张图片就是select最右边的箭头---->
        <img style="position:absolute;top:102px;left:384px;" border="0px" src="select.bmp" onclick="ShowDiv()"/>
        <div id="divSelect" style="position:absolute;left:100px;top:121px; border:solid 1px black;width:300px;display:none">
        <div onmouseover="this.style.backgroundColor='#082569';this.style.color='white';" 
        onmouseout="this.style.backgroundColor='white';this.style.color='black';" onclick="SetSpan(this.innerHTML,event)">
        请选择......</div>
        <div onmouseover="this.style.backgroundColor='#082569';this.style.color='white';" 
        onmouseout="this.style.backgroundColor='white';this.style.color='black';" onclick="SetSpan(this.innerHTML,event)">
        Item1 <input type="checkbox" />1 <input type="checkbox" />2 <input type="checkbox" />3 
        <input type="checkbox" />4 <input type="checkbox" />5</div>
        <div onmouseover="this.style.backgroundColor='#082569';this.style.color='white';" 
        onmouseout="this.style.backgroundColor='white';this.style.color='black';" onclick="SetSpan(this.innerHTML,event)">
        Item2 <input type="checkbox" />1 <input type="checkbox" />2 <input type="checkbox" />3 
        <input type="checkbox" />4 <input type="checkbox" />5</div>
        <div onmouseover="this.style.backgroundColor='#082569';this.style.color='white';" 
        onmouseout="this.style.backgroundColor='white';this.style.color='black';" onclick="SetSpan(this.innerHTML,event)">
        Item3 <input type="checkbox" />1 <input type="checkbox" />2 <input type="checkbox" />3 
        <input type="checkbox" />4 <input type="checkbox" />5</div>
        <div onmouseover="this.style.backgroundColor='#082569';this.style.color='white';" 
        onmouseout="this.style.backgroundColor='white';this.style.color='black';" onclick="SetSpan(this.innerHTML,event)">
        Item4 <input type="checkbox" />1 <input type="checkbox" />2 <input type="checkbox" />3 
        <input type="checkbox" />4 <input type="checkbox" />5</div>
        <div onmouseover="this.style.backgroundColor='#082569';this.style.color='white';" 
        onmouseout="this.style.backgroundColor='white';this.style.color='black';" onclick="SetSpan(this.innerHTML,event)">
        Item5 <input type="checkbox" />1 <input type="checkbox" />2 <input type="checkbox" />3 
        <input type="checkbox" />4 <input type="checkbox"/>5</div>
        </div>
      </body>
    </html>