我在页面上部放了两个Calendar控件(隐藏的),分别表示开始时间和结束时间,在日历控件下面有一个DataGrid控件,再分别设置两个ImageButton,点击按扭则日历控件的显示出来,可是当他显示出来后,就和下面的DataGrid控件重叠!字都看不清,太难看了,有没有办法使其象下拉列表框一样,当下拉时会将其他控件遮住一部分?
另外我想实现这个效果:当鼠标在日历控件以外的区域点击时,日历控件隐藏(有时候用户点出该控件后,想放弃选择),怎么判断输入焦点不在日历控件中?

解决方案 »

  1.   

    我使用了Panel,下面是部分代码:
    <asp:Panel id="Panel1" style="Z-INDEX: 123; LEFT: 176px; POSITION: absolute; TOP: 80px" runat="server" Visible="False" Width="256px" Height="184px">
       <asp:calendar id="Calstart" style="Z-INDEX: 109; LEFT: 176px; POSITION: absolute; TOP: 80px" runat="server" Height="184px" Width="256px"></asp:calendar>
    </asp:Panel>

    <asp:ImageButton id="Imagestart" style="Z-INDEX: 110; LEFT: 176px; POSITION: absolute; TOP: 80px" runat="server" <asp:Panel id="Panel2" style="Z-INDEX: 123; LEFT: 328px; POSITION: absolute; TOP: 80px" runat="server" Visible="False" Width="256px" Height="184px">
      <asp:Calendar id="Calend" style="Z-INDEX: 112; LEFT: 328px; POSITION: absolute; TOP: 80px" runat="server" Height="184px" Width="256px">
                    </asp:Calendar>
    Onclick="enablestart">
                    </asp:ImageButton>
    <asp:ImageButton id="Imageend" style="Z-INDEX: 111; LEFT: 328px; POSITION: absolute; TOP: 80px" runat="server" Onclick="enablestart">
                    </asp:ImageButton>
                    
    </asp:Panel>
    private void enablestart(object sender, System.Web.UI.ImageClickEventArgs e)
    {
    Panel1.Visible=true;

    }
    private void enableend(object sender, System.Web.UI.ImageClickEventArgs e)
    {
    Panel2.Visible=true;

    }
      

  2.   

    用JavaScript自己写一个弹出式日历控件.
      

  3.   

    han_melody(寒羽良):见笑了,js我还要现学呢,就是想要弹出式效果。难道C#没有解决方法?
      

  4.   

    你的信箱是多少?我发给你用JavaScript写的一个弹出式日历控件
      

  5.   

    不麻烦,它将在页面上显示一个类似textbox控件和一个button控件,当你单击button控件是,日历控件弹出,当你选定好年,月,日时,你所选定的日期自动显示在textbox控件中