I have the following Linq Query which links data from SQL Server and an ODBC source (Cache as it happens)
Dim items = _
From p In dtCurrentPatients.AsEnumerable() _
Group Join s In dtScores.AsEnumerable() _
On p.Field(Of String)("HospitalNumber") Equals s.Field(Of String)("HospitalNumber") _
Into PList = Group _
From HasScore In PList.DefaultIfEmpty() _
Select New Patient() With { _
.Score = If(HasScore Is Nothing, String.Empty, HasScore.Field(Of String)("Score")), _
.LastScored = If(HasScore Is Nothing, String.Empty, (HasScore.Field(Of Date)("DateTimeScored")).ToString("dd MMM yyyy hh:mm")), _
.HospitalNumber = p.Field(Of String)("HospitalNumber"), _
.Name = String.Format("{0}, {1}", p.Field(Of String)("Surname"), p.Field(Of String)("Firstname")), _
.Bed = If(HasScore Is Nothing, String.Empty, HasScore.Field(Of String)("BedNumber")), _
.HandOver = If(HasScore Is Nothing, String.Empty, HasScore.Field(Of String)("DiagnosisPlan")) _
}
This is then used in the following Grid
<asp:GridView ID="grdDependency" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" AutoGenerateColumns="False"
BorderColor="DodgerBlue" BorderStyle="Ridge" BorderWidth="4px" EditRowStyle-ForeColor="Bisque"
Font-Names="Arial" Font-Size="8pt" Width="90%" AllowSorting="True">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" ForeColor="White" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="False" ForeColor="White" Font-Names="Arial"
Font-Size="8pt" HorizontalAlign="Left" />
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:CommandField ShowEditButton="True" HeaderImageUrl="~/images/edit.gif" />
<asp:TemplateField HeaderText="Hospital Number">
<ControlStyle Width="35px" />
<ItemStyle HorizontalAlign="Left" Width="100px" />
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Container.DataItem.HospitalNumber %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Patient">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemStyle Font-Bold="true" />
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItem.Name %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Dependency Score">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" Text='<%# Container.DataItem.Score %>'>
<asp:ListItem Text="0"></asp:ListItem>
<asp:ListItem Text="1a"></asp:ListItem>
<asp:ListItem Text="1b"></asp:ListItem>
<asp:ListItem Text="2"></asp:ListItem>
<asp:ListItem Text="3"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text="<%# Container.DataItem.Score %>"></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Last Scored">
<ItemTemplate>
<asp:Label ForeColor='<%# GetLastScoredColour(Container.DataItem.LastScored) %>' ID="Label4" runat="server" Text="<%# Container.DataItem.LastScored %>"></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Bed">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
However when I click on the EDIT Command it still does not allow me to actually change values in the grid.
What really obvious thing am I missing?