GridView not updating !!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ArdoyneRed
    New Member
    • Jan 2008
    • 2

    GridView not updating !!!

    Hello all,

    I have a problem with GridView - basically it will not update with the new values entered in edit mode.

    I'm not sure why because when you step through the code you can see in e.NewValues that the updated values are being captured but for some reason not written to the data table.

    Can anyone help??

    Thanks in advance,
    Sean
  • harignair
    New Member
    • Dec 2007
    • 2

    #2
    Please post the code.

    Comment

    • ArdoyneRed
      New Member
      • Jan 2008
      • 2

      #3
      Code:
                     <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                      DataKeyNames="CurrencyID" DataSourceID="ObjectDataSource1" ForeColor="#333333"
                      GridLines="None" OnRowUpdating="GridView1_RowUpdating" OnRowUpdated="GridView1_RowUpdated" style="z-index: 100; left: 14px; position: absolute; top: 94px">
                      <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                      <Columns>
                          <asp:BoundField DataField="CurrencyID" HeaderText="CurrencyID" InsertVisible="False"
                              ReadOnly="True" SortExpression="CurrencyID" />
                          <asp:BoundField DataField="Code" HeaderText="Code" SortExpression="Code" />
                          <asp:BoundField DataField="Symbol" HeaderText="Symbol" SortExpression="Symbol" />
                          <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                          <asp:BoundField DataField="Rate" HeaderText="Rate" SortExpression="Rate" />
                      </Columns>
                      <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                      <EditRowStyle BackColor="#999999" />
                      <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                      <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                      <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                      <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                  </asp:GridView>
                  
                  <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="{0}" SelectMethod="GetData"
                      TypeName="Sunderlands.Events.Provider.AbetaWebAdminDatasetTableAdapters.currencyTableAdapter"
                      UpdateMethod="Update" DeleteMethod="Delete" InsertMethod="Insert">
                      <UpdateParameters>
                          <asp:Parameter Name="Code" Type="String" />
                          <asp:Parameter Name="Symbol" Type="String" />
                          <asp:Parameter Name="Name" Type="String" />
                          <asp:Parameter Name="Rate" Type="Double" />
                          <asp:Parameter Name="Original_CurrencyId" Type="Int16" />
                          <asp:Parameter Name="CurrencyID" Type="Int16" />
                      </UpdateParameters>
                  </asp:ObjectDataSource>
      Last edited by ArdoyneRed; Jan 14 '08, 01:56 PM. Reason: Incorrect code sample

      Comment

      • thiagarajanrsbe
        New Member
        • Jan 2008
        • 5

        #4
        Dear Sir/Madam,

        Please send this solution as a cs file........im also having that problem.......
        im using gridt_RowUpdati ng event.......... ..pls help me to solve the problem

        Comment

        Working...