Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have problem with ajax calendar control binding with gridview control in asp.net. It giving browser error.
Plz give me solution anybody have.
This is way how i bind the ajax caledar in gridview:

XML
<asp:GridView ID="gv" runat="server" AutoGenerateColumns="False"
            DataKeyNames="id" Width="60%"  CssClass="grid-view">

            <Columns>
             <asp:BoundField DataField="id" HeaderText="" />

                 <asp:BoundField DataField="FieldType" HeaderText=""  Visible="true">
                 <ItemStyle Width="0%"/>
                 </asp:BoundField>
                <asp:BoundField DataField="FieldName" HeaderText="Field Name" />
                  <asp:TemplateField HeaderText ="Text Value">
                <ItemTemplate>

                 <asp:TextBox ID="txt" runat="server" Text="" CssClass="input"></asp:TextBox>
                  <asp:Image ID="Image3" runat="server" CssClass="imgcal" ImageUrl="~/Images/cal.png" />
                     <cc1:CalendarExtender ID="CalendarExtender1" runat="server"
                Enabled="True" PopupButtonID="Image3"   Format="MM/dd/yyyy"
                TargetControlID="txt"></cc1:CalendarExtender>


                </ItemTemplate>
                </asp:TemplateField>

            </Columns>
            <RowStyle />


        </asp:GridView>
Posted
Updated 10-Jun-10 20:38pm
v2
Comments
Sandeep Mewara 10-Jun-10 11:14am    
1. You need to post about Error! What you get. 2. You might need to add code-snippet that gives you the error.

1 solution

use proper formating strings... to format the date of AjaxCalendarControls....

see the link below for AjaxCalendarControl demonstration..
http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Calendar/Calendar.aspx

and to give the value for "Format" property of string have a look on the Format Strings in the link below.............

http://msdn.microsoft.com/en-us/library/bb79761a-ca08-44ee-b142-b06b3e2fc22b.aspx

<cc1:calendarextender id="CalendarExtender1" runat="server" xmlns:cc1="#unknown">
               Enabled="True" PopupButtonID="Image3"   Format="MMMM d, yyyy"
               TargetControlID="txt"></cc1:calendarextender>
 
Share this answer
 
v3
Comments
Sandeep Mewara 25-Jul-10 16:00pm    
Reason for my vote of 1
And why is so? What's the reason behind it? Any difference?
koool.kabeer 27-Jul-10 5:52am    
has it worked?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900