LinqDataSource wont run updates on all columns of a GridView?

A

Andy B

I have a GridView with a LINQDataSource attached to it. My code in the aspx
markup is below. I need to know why only the checkbox field for the
activated column is getting updated (the EditTemplate). None of the other
columns get updated except for that one. Any ideas? The only column that is
not able to be updated is the ID column, but that isn't even in the table.

<asp:GridView ID="EternityNewsMemberList" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataSourceID="EternityNewsMemberListDataSource"
EmptyDataText="There are no members yet." HorizontalAlign="Center"
ShowFooter="True" DataKeyNames="ID">

<Columns>

<asp:TemplateField HeaderText="Name" SortExpression="Name">

<FooterTemplate>

<asp:Label ID="Label3" runat="server" Text="Name"></asp:Label>&nbsp;

<asp:TextBox ID="Insert_NewsletterSubscriberNameTextBox"
runat="server"></asp:TextBox>

</FooterTemplate>

<EditItemTemplate>

<asp:TextBox ID="Edit_NewsletterSubscriberNameTextBox" runat="server"
Text='<%# Eval("Name") %>'></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="Label1" runat="server" Text='<%# Bind("Name")
%>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Email Address" SortExpression="EmailAddress">

<FooterTemplate>

<asp:Label ID="Label4" runat="server" Text="Email
address"></asp:Label>&nbsp;

<asp:TextBox ID="Insert_NewsLetterSubscriberEmailAddressTextBox"
runat="server"></asp:TextBox>

</FooterTemplate>

<EditItemTemplate>

<asp:TextBox ID="Edit_NewsletterSubscriberEmailAddressTextBox"
runat="server" Text='<%# Eval("EmailAddress") %>'></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="Label2" runat="server" Text='<%# Bind("EmailAddress")
%>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Activated" SortExpression="Activated">

<FooterTemplate>

<asp:Label ID="Label5" runat="server" Text="Activated, automatically set to
yes."></asp:Label>

</FooterTemplate>

<EditItemTemplate>

<asp:CheckBox ID="Edit_NewsletterSubscriberActivatedCheckBox" runat="server"
Checked='<%# Bind("Activated") %>' />

</EditItemTemplate>

<ItemTemplate>

<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Activated")
%>' Enabled="false" />

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField ShowHeader="False">

<FooterTemplate>

<asp:LinkButton ID="EternityNewsInsertLinkButton" runat="server"
Text="Insert" />

</FooterTemplate>

<EditItemTemplate>

<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True"
CommandName="Update" Text="Update"></asp:LinkButton>

&nbsp;<asp:LinkButton ID="LinkButton2" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel"></asp:LinkButton>

</EditItemTemplate>

<ItemTemplate>

<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit"></asp:LinkButton>

&nbsp;<asp:LinkButton ID="LinkButton2" runat="server"
CausesValidation="False" CommandName="Delete"
Text="Delete"></asp:LinkButton>

</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>

<asp:LinqDataSource ID="EternityNewsMemberListDataSource" runat="server"
ContextTypeName="Main.DataSources.MailingListsDataContext"
TableName="EternityNews" EnableDelete="True" EnableUpdate="True">

</asp:LinqDataSource>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,795
Messages
2,569,644
Members
45,358
Latest member
TreyTritt8

Latest Threads

Top