LinqDataSource wont run updates on all columns of a GridView?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy B

    #1

    LinqDataSource wont run updates on all columns of a GridView?

    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="EternityNew sMemberList" runat="server" AllowPaging="Tr ue"
    AutoGenerateCol umns="False" DataSourceID="E ternityNewsMemb erListDataSourc e"
    EmptyDataText=" There are no members yet." HorizontalAlign ="Center"
    ShowFooter="Tru e" DataKeyNames="I D">

    <Columns>

    <asp:TemplateFi eld HeaderText="Nam e" SortExpression= "Name">

    <FooterTemplate >

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

    <asp:TextBox ID="Insert_News letterSubscribe rNameTextBox"
    runat="server"> </asp:TextBox>

    </FooterTemplate>

    <EditItemTempla te>

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

    </EditItemTemplat e>

    <ItemTemplate >

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

    </ItemTemplate>

    </asp:TemplateFie ld>

    <asp:TemplateFi eld HeaderText="Ema il Address" SortExpression= "EmailAddre ss">

    <FooterTemplate >

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

    <asp:TextBox ID="Insert_News LetterSubscribe rEmailAddressTe xtBox"
    runat="server"> </asp:TextBox>

    </FooterTemplate>

    <EditItemTempla te>

    <asp:TextBox ID="Edit_Newsle tterSubscriberE mailAddressText Box"
    runat="server" Text='<%# Eval("EmailAddr ess") %>'></asp:TextBox>

    </EditItemTemplat e>

    <ItemTemplate >

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

    </ItemTemplate>

    </asp:TemplateFie ld>

    <asp:TemplateFi eld HeaderText="Act ivated" SortExpression= "Activated" >

    <FooterTemplate >

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

    </FooterTemplate>

    <EditItemTempla te>

    <asp:CheckBox ID="Edit_Newsle tterSubscriberA ctivatedCheckBo x" runat="server"
    Checked='<%# Bind("Activated ") %>' />

    </EditItemTemplat e>

    <ItemTemplate >

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

    </ItemTemplate>

    </asp:TemplateFie ld>

    <asp:TemplateFi eld ShowHeader="Fal se">

    <FooterTemplate >

    <asp:LinkButt on ID="EternityNew sInsertLinkButt on" runat="server"
    Text="Insert" />

    </FooterTemplate>

    <EditItemTempla te>

    <asp:LinkButt on ID="LinkButton1 " runat="server" CausesValidatio n="True"
    CommandName="Up date" Text="Update"></asp:LinkButton>

    &nbsp;<asp:Link Button ID="LinkButton2 " runat="server"
    CausesValidatio n="False" CommandName="Ca ncel"
    Text="Cancel"></asp:LinkButton>

    </EditItemTemplat e>

    <ItemTemplate >

    <asp:LinkButt on ID="LinkButton1 " runat="server" CausesValidatio n="False"
    CommandName="Ed it" Text="Edit"></asp:LinkButton>

    &nbsp;<asp:Link Button ID="LinkButton2 " runat="server"
    CausesValidatio n="False" CommandName="De lete"
    Text="Delete"></asp:LinkButton>

    </ItemTemplate>

    </asp:TemplateFie ld>

    </Columns>

    </asp:GridView>

    <asp:LinqDataSo urce ID="EternityNew sMemberListData Source" runat="server"
    ContextTypeName ="Main.DataSour ces.MailingList sDataContext"
    TableName="Eter nityNews" EnableDelete="T rue" EnableUpdate="T rue">

    </asp:LinqDataSou rce>


Working...