Hello all, I need assistance... I have been trying to include a calender in my project with no luck... the form is a detailed gridview. I would like to form to function as follows. User selects linkbutton called edit which allows a user to select an imagebutton called imgcal, on click i would like for a calendar to appear. the selected date from the calendar autofill into the textbox called target date.. I have had no luck getting this to work. would some happen to know how.... thanks for your assistance
included is the code.........
************************************code
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None"
BorderWidth="1px" CellPadding="4" DataKeyNames="TaskNumber" DataSourceID="objRs">
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="lnkDelete" runat="server" CausesValidation="False" CommandName="Delete"
OnClientClick="return confirm('Are you certain you want to delete this record? ')">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="TaskNumber" HeaderText="#" InsertVisible="False" ReadOnly="True"
SortExpression="TaskNumber" />
<asp:BoundField ApplyFormatInEditMode="True" DataField="DateOpened" DataFormatString="{0:d}"
HeaderText="Date Opened" HtmlEncode="False" SortExpression="DateOpened" ReadOnly="True" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" ReadOnly="True" />
<asp:BoundField DataField="PointPerson" HeaderText="Point Person" SortExpression="PointPerson" ReadOnly="True" />
<asp:TemplateField HeaderText="TargetDate" SortExpression="TargetDate">
<EditItemTemplate>
<asp:TextBox ID="txtTargetDate" runat="server" Text='<%# Bind("TargetDate", "{0:d}") %>'></asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/cal.gif" OnClick="ImageButton1_Click" />
<asp:Calendar ID="calDate" runat="server" SelectedDate="<%# Now() %>" Visible="False"
VisibleDate="<%# Now() %>"></asp:Calendar>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("TargetDate", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CompletionIssues" HeaderText="Completion Issues" SortExpression="CompletionIssues" />
<asp:BoundField DataField="Resolution" HeaderText="Resolution" SortExpression="Resolution" />
<asp:BoundField ApplyFormatInEditMode="True" DataField="DateClosed" DataFormatString="{0:d}"
HeaderText="Date Closed" HtmlEncode="False" SortExpression="DateClosed" />
<asp:CheckBoxField DataField="Done" HeaderText="Done" SortExpression="Done" />
</Columns>
<RowStyle BackColor="White" ForeColor="#003399" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
<HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
</asp:GridView>
included is the code.........
************************************code
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None"
BorderWidth="1px" CellPadding="4" DataKeyNames="TaskNumber" DataSourceID="objRs">
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="lnkDelete" runat="server" CausesValidation="False" CommandName="Delete"
OnClientClick="return confirm('Are you certain you want to delete this record? ')">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="TaskNumber" HeaderText="#" InsertVisible="False" ReadOnly="True"
SortExpression="TaskNumber" />
<asp:BoundField ApplyFormatInEditMode="True" DataField="DateOpened" DataFormatString="{0:d}"
HeaderText="Date Opened" HtmlEncode="False" SortExpression="DateOpened" ReadOnly="True" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" ReadOnly="True" />
<asp:BoundField DataField="PointPerson" HeaderText="Point Person" SortExpression="PointPerson" ReadOnly="True" />
<asp:TemplateField HeaderText="TargetDate" SortExpression="TargetDate">
<EditItemTemplate>
<asp:TextBox ID="txtTargetDate" runat="server" Text='<%# Bind("TargetDate", "{0:d}") %>'></asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/cal.gif" OnClick="ImageButton1_Click" />
<asp:Calendar ID="calDate" runat="server" SelectedDate="<%# Now() %>" Visible="False"
VisibleDate="<%# Now() %>"></asp:Calendar>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("TargetDate", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CompletionIssues" HeaderText="Completion Issues" SortExpression="CompletionIssues" />
<asp:BoundField DataField="Resolution" HeaderText="Resolution" SortExpression="Resolution" />
<asp:BoundField ApplyFormatInEditMode="True" DataField="DateClosed" DataFormatString="{0:d}"
HeaderText="Date Closed" HtmlEncode="False" SortExpression="DateClosed" />
<asp:CheckBoxField DataField="Done" HeaderText="Done" SortExpression="Done" />
</Columns>
<RowStyle BackColor="White" ForeColor="#003399" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
<HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
</asp:GridView>