Hi
I am trying to use the calender control from the website , i am trying to create the function
Protected Function DisplayDaysOnJob(ByVal employee As
Northwind.EmployeesRow) As String
but the problem is i couldnt get the object of Northwind.EmployeeRow ....
I have used the SQL Datasource in this whole exercise....
Code is Give bellow:
1 <%@ Page Language="
vb" AutoEventWireup="false" CodeBehind="ItemTemplate.aspx.
vb" Inherits="GridViewRetriefValues.ItemTemplate" %>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml" >
6 <head runat="server">
7 <title>Untitled Page</title>
8 </head>
9 <body>
10 <form id="form1" runat="server">
11 <div>
12 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
13 SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [TitleOfCourtesy], [City], [Country], [HireDate] FROM [Employees]">
14 </asp:SqlDataSource>
15 <asp:Button ID="Button2" runat="server" Style="position: relative" Text="Show Records" />
16 <asp:GridView ID="GridView1" runat="server" CellPadding="4" DataMember="DefaultView"
17 DataSourceID="SqlDataSource1" Style="left: 32px;
18 position: relative; top: 43px" Visible="False" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px">
19 <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
20 <RowStyle BackColor="White" ForeColor="#330099" />
21 <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
22 <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
23 <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
24 <Columns>
25 <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" InsertVisible="False"
26 ReadOnly="True" SortExpression="EmployeeID" />
27 <asp:TemplateField HeaderText="TitleOfCourtesy" SortExpression="TitleOfCourtesy">
28 <EditItemTemplate>
29 <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("TitleOfCourtesy") %>'></asp:TextBox>
30 </EditItemTemplate>
31 <HeaderTemplate>
32 Full Name
33 </HeaderTemplate>
34 <ItemTemplate>
35 <asp:Label ID="Label1" runat="server" Text='<%# Eval("TitleOfCourtesy") %>'></asp:Label>
36 <asp:Label ID="Label2" runat="server" Style="position: relative" Text='<%# Eval("FirstName") %>'></asp:Label>
37 <asp:Label ID="Label3" runat="server" Style="position: relative" Text='<%# Eval("LastName") %>'></asp:Label>
38 </ItemTemplate>
39 </asp:TemplateField>
40 <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
41 <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
42 <asp:TemplateField HeaderText="HireDate" SortExpression="HireDate">
43 <EditItemTemplate>
44 <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("HireDate") %>'></asp:TextBox>
45 </EditItemTemplate>
46 <ItemTemplate>
47 <asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66"
48 BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
49 ForeColor="#663399" Height="200px" SelectedDate='<%# Eval("HireDate") %>' ShowGridLines="True"
50 Style="position: relative" VisibleDate='<%# Eval("HireDate") %>' Width="220px">
51 <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
52 <TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
53 <SelectorStyle BackColor="#FFCC66" />
54 <OtherMonthDayStyle ForeColor="#CC9966" />
55 <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
56 <DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
57 <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" />
58 </asp:Calendar>
59 </ItemTemplate>
60 </asp:TemplateField>
61 </Columns>
62
63
64
65 </asp:GridView>
66 </div>
67 </form>
68 </body>
69 </html>
70
Cheers
Sheraz