如何在GridView中显示单个日历 [英] How to show the single calender in gridview

查看:90
本文介绍了如何在GridView中显示单个日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在我的应用程序中使用的是gridview,因为我使用的是压延控件.当我单击压延机的图像按钮时,它将显示多个压延机.单击图像按钮时,我只想显示一个压光机.谁能帮我解决这个问题.

在Advance中致谢

Hi,

I am using the gridview in my application in that I am using the calender control. When I click the image button for the calender it displays the multiple calenders. I want to display only one calender when clicking the image button. Can anyone help me to solve this problem.

Thanks in Advance

推荐答案

好的,所以在我的地板上呆了几个小时后,我醒了,在监视器上看到了此页面.再次阅读问题后,我真的认为我可能已经严重误解了OP的问题!但是以防万一,这是他想知道的,我会把它留给他和其他人使用,以备将来使用.我认为可能是该问题的答案,请参见解决方案2.

该代码仅用于在MonthCalendar(Windows Forms)或Calendar(ASP.Net)中显示当前月份,它禁用(WinForms)或删除(ASP.Net)日历上的上/下个月控件,并删除日期当前月份日历页面上的前一个月和下一个月.
-------------------------------------------------- -------------------------
我不确定您的要求是什么,但这是我针对ASP.Net和Windows Forms应用程序的解决方案,也许这可以帮助您解决问题.

Windows Forms应用程序:
Ok so after passing out on my floor for a couple of hours I woke up and saw this page on my monitor. After reading the question again I really think I may have seriously misunderstood the OP''s question! But just in case this is what he wanted to know I will leave it here for him and for others that it may help in the future. See solution 2 for what I think may be the answer to this question.

This code it used to display the current month only in a MonthCalendar(Windows Forms) or Calendar(ASP.Net) it disables(WinForms) or removes(ASP.Net) the prev/next month controls on the calendar and removes the days of the previous and next months from the current months calendar page.
---------------------------------------------------------------------------
I am not exactly sure of what your asking for but here are my solutions for ASP.Net and Windows Forms app maybe this will help you figure something out.

Windows Forms App:
private void button1_Click(object sender, EventArgs e)
{
    MonthCalendar calender = new MonthCalendar();
    this.Controls.Add(calender);
    DateTime today = DateTime.Today;
    calender.MinDate = new DateTime(today.Year, today.Month, 1);
    calender.MaxDate = new DateTime(today.Year, today.Month,
    DateTime.DaysInMonth(today.Year, today.Month));
    calender.Show();
}



其他ASP.Net应用程序:



Else ASP.Net app:

Calendar1.ShowNextPrevMonth = false;



并从当前日历中隐藏上个月和下个月的日期,请在日历DayRender事件处理程序中使用此方法



and to hide previous and next month days from current calender use this in the calenders DayRender event handler

protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    if (e.Day.IsOtherMonth)
    {
        e.Cell.Text = "";
    }
}


这可能对您有所帮助:)
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx
This May be Helpful for you :)
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx


我认为您给了相同的图像按钮ID到两个或多个压光机控件.

一次检查一次.
I think you have given same image button id to two or more calender controls.

Check it once.


这篇关于如何在GridView中显示单个日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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