Hello
I have i Gridview with a templatefield. Calender shows on edit for users to be able to change date. It does not work. Thx for help. Best regards Halvard
<asp:GridView ID="GridView7" runat="server" DataSourceID="SqlDataSource6" EnableModelValidation="True" AllowSorting="True" AutoGenerateColumns="False" >
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:TemplateField HeaderText="Förfallodatum" SortExpression=" Förfallodatum" >
<EditItemTemplate>
<asp:Calendar ID="Calendar1" runat="server" VisibleIndex="4"
SelectedDate='<%# Bind("Forfallodatum") %>'
VisibleDate='<%# Eval("Forfallodatum") %>'>
</asp:Calendar>
<asp:TextBox ID="TextBox3" runat="server"
Text='<%# Bind("Forfallodatum") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
Text='<%# Eval("Forfallodatum") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
UpdateCommand="UPDATE faktura SET Forfallodatum = ? WHERE nr = ?
<UpdateParameters>
<asp:ControlParameter ControlID="TextBox3"
Name="Forfallodatum"
Type="DateTime" />
<asp:Parameter Name="nr" Type="Int32" />
</UpdateParameters>
if (!Page.IsPostBack)
{
GridView7.DataBind();
}