Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help... datagrid and calendars

Status
Not open for further replies.

dembyg

Programmer
Oct 20, 2001
58
0
0
US
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>&nbsp;&nbsp;&nbsp;
<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>
 
check out basic date picker they have a free lite version. the full version is excellent and only costs $200 for a developers license.

you could also checkout the calendar control included with the MS AJAX Toolkit

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thank for your responds I will look into the basic date picker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top