AJAX Calendar Extender Problem

Last post 07-04-2009 6:40 AM by Alekhya.Muvva. 10 replies.

Sort Posts:

  • AJAX Calendar Extender Problem

    11-13-2007, 3:54 AM
    • Member
      1 point Member
    • mparamasivan
    • Member since 05-19-2007, 5:18 AM
    • Posts 9

    I am using the Calendar Extender along with a button in one of the column within a GridView Control to change the date. When I click the button in a row, the Calendar pops up. When I click the button again, the popup calendar closes automatically. But when I click the button in the first row and then in the second row and so on, then many calendars popup.  Is it possible to automatically close the first calendar when the second calendar pops up using javascript code or by some other means. Please help me to solve the issue

     Also when there is a scroll bar in the gridview, the position of the calendar popup is not coming correctly. Is it possible to change the position of the Calendar popup using javascript.

  • Re: AJAX Calendar Extender Problem

    11-14-2007, 12:55 AM
    • Member
      248 point Member
    • shihalv
    • Member since 10-26-2006, 2:24 AM
    • Posts 266

    Yes its possible

    Do the following through javascript...

    $find(<behaviourID>).set_popupPosition(<position>);

    <position> can be the following values

    AjaxControlToolkit.CalendarPosition.BottomLeft

    AjaxControlToolkit.CalendarPosition.BottomRight

    AjaxControlToolkit.CalendarPosition.TopLeft

    AjaxControlToolkit.CalendarPosition.TopRight

    <behaviourID> is a property that can be set in the Extender itself.  If not set it will default to the ClientID

    Alvin Shih
    Software Developer
    MCP MCTS MCPD
  • Re: AJAX Calendar Extender Problem

    11-14-2007, 5:32 AM
    • Member
      1 point Member
    • mparamasivan
    • Member since 05-19-2007, 5:18 AM
    • Posts 9

    Hello Alvin Shih,

    Thanks for the response. I have fixed the position using CSS.

    Can anyone help me in hiding the  Calendar Extender popup automatically using javascript when the user clicks some other controls. I am having the calendar extender in the GridView

    Param 

     

     

     

  • Re: AJAX Calendar Extender Problem

    11-14-2007, 6:11 AM
    Answer
    • Member
      248 point Member
    • shihalv
    • Member since 10-26-2006, 2:24 AM
    • Posts 266

    Similarly, you can use the technique $find(<behaviourID>).show() or $find(<behaviourID>).hide() through javascript.

    Alvin Shih
    Software Developer
    MCP MCTS MCPD
  • Re: AJAX Calendar Extender Problem

    11-23-2007, 4:23 AM
    • Member
      47 point Member
    • sonnyikea
    • Member since 05-04-2005, 1:51 PM
    • Posts 39

    Hi, how did you fix the position?

  • Re: AJAX Calendar Extender Problem

    11-23-2007, 4:39 AM
    • Member
      1 point Member
    • mparamasivan
    • Member since 05-19-2007, 5:18 AM
    • Posts 9

    Hi,

    I have fixed the position using CSS.

    I have used the extender within the grid, I have used the following lines for my requirement

    /*calendar extender*/
    .ajax__calendar
    {
     position:absolute;   
        left: 0px !important;
        top: 0px !important;
       
    }
    .ajax__calendar iframe
    {
        left: 0px !important;
        top: 0px !important;
    }

  • Re: AJAX Calendar Extender Problem

    11-23-2007, 4:47 AM
    • Member
      47 point Member
    • sonnyikea
    • Member since 05-04-2005, 1:51 PM
    • Posts 39

    Thanks, I tried this but it doesn't work. Is your grid inside a scrollable div?

  • Re: AJAX Calendar Extender Problem

    11-23-2007, 8:18 AM
    • Member
      1 point Member
    • mparamasivan
    • Member since 05-19-2007, 5:18 AM
    • Posts 9
    Yes I have put the grid inside the div tag.
  • Re: AJAX Calendar Extender Problem

    09-19-2008, 1:14 PM
    • Member
      133 point Member
    • JProgrammer
    • Member since 04-01-2008, 1:49 AM
    • Lima - Peru
    • Posts 175

    Hi there, i was reading this post, i have an issue something like the author, but in my case, the position of the calendar is at the buttom of the html, i said i have a gridview with divs and the calendar is showing behind it, an image is attached, Thanks in advance Smile!...

    Please dont forget mark as an answer, if this post helped you... Thanks!

    C# my main PL in .NET
  • AJAX Calendar Extender Problem

    10-03-2008, 11:46 PM
    • Member
      48 point Member
    • rishnan
    • Member since 10-03-2008, 4:16 AM
    • Jurong, Singapore
    • Posts 25

    <asp:TemplateField HeaderText="Pulled Date" SortExpression="PulledDate">

    <EditItemTemplate>

    <asp:TextBox ID="PulledDateTextBox" runat="server" Text='<%# AssetsDBSupport.Utils.DisplayShortDate (Eval("PulledDate")) %>'> </asp:TextBox>

    <ajaxToolkit:CalendarExtender ID="CalendarExtender" runat="server" TargetControlID="PulledDateTextBox"

    CssClass="MyCalendar" Format="dd/MM/yyyy"/>

    </EditItemTemplate>

    </asp:TemplateField>

    I have the Date Column Like above. When I update in the grid view I am getting null value as date. But i chosen some date in this feild.

    The code i written as follows:

    protected void ObjectDSCable_ItemUpdating(object sender, ObjectDataSourceMethodEventArgs e)

    {

    CultureInfo culture = new CultureInfo("en-GB");

    DateTime dt1 = Convert.ToDateTime("1-1-1900", culture);

    DateTime dt2 = Convert.ToDateTime("1-1-1900", culture);

     

    TextBox txtPulledDate = (TextBox)GridViewCable.FindControl("PulledDateTextBox");if (txtPulledDate != null)

    {

    if (txtPulledDate.Text.Length > 8)

    {

    dt1 = Convert.ToDateTime(txtPulledDate.Text, culture);

    e.InputParameters["PulledDate"] = dt1;

    }

    }

    }

     

    The same code is works fine in my FormView but in the Grid View not working.Getting only null value..

    Can You solve this issue?

     

    Regards,
    Gobalakrishnan
  • Re: AJAX Calendar Extender Problem

    07-04-2009, 6:40 AM

     Try to remove the position(absolute or relative) style which is applied to the gridview divs or to the gridview itself.

    It worked for me.

     

    Mark As Answer if helped.

Page 1 of 1 (11 items)