Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8582193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:13:57+00:00 2026-06-11T21:13:57+00:00

Hope you have a good weekend. At long last I have got some editing/delete

  • 0

Hope you have a good weekend.
At long last I have got some editing/delete eventer to work with LINQ support.
I have an Add record event which I know is working, but after trying a part, I do not know how I am adding some textbox’s in my footer.

So it is a row from header and down to footer, without the move to the right or the left.
Can some help me !?

enter image description here

My code is

    <asp:GridView ID="gdview"  runat="server" AutoGenerateColumns="False" DataKeyNames="test_id" OnRowCancelingEdit="gdview_RowCancelingEdit" OnRowDeleting="gdview_RowDeleting" OnRowEditing="gdview_RowEditing" OnRowUpdating="gdview_RowUpdating"
        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal" ShowFooter="true">
        <Columns>
        <asp:BoundField HeaderText="Test CAT" DataField="test_cat">
            <ItemStyle Height="20px" Width="150px" />
        </asp:BoundField>
        <asp:BoundField HeaderText="Test INFO" DataField="test_info">
            <ItemStyle Height="20px" Width="150px" />
        </asp:BoundField>  
        <asp:BoundField HeaderText="Test NUMBER" DataField="test_number">
            <ItemStyle Height="20px" Width="150px" />
        </asp:BoundField>   
        <asp:BoundField HeaderText="Test DATE" DataField="test_datetime">
            <ItemStyle Height="20px" Width="150px" />
        </asp:BoundField>       
        <asp:CommandField ShowEditButton="True">
            <ItemStyle Width="100px" />
        </asp:CommandField>
        <asp:TemplateField>
        <ItemTemplate>
          <asp:LinkButton ID="lnkdel" runat="server" Text="Delete" CommandName="Delete"   OnClientClick="return confirm('Do you want to delete?')"></asp:LinkButton>      
        </ItemTemplate>
        <ItemStyle Width="100px" />
        </asp:TemplateField>

    </Columns>
    <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
    <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
    <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F7F7F7" />
    <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
    <SortedDescendingCellStyle BackColor="#E5E5E5" />
    <SortedDescendingHeaderStyle BackColor="#242121" />
    </asp:GridView>

Ok but how with this then work, if i use templates, how do it know what cell to get values from !??

 Protected Sub gdview_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs)
    Using db As New ThedatabaseconnectionDataContext()
        Try
            'getting table
            Dim tbltest As Table(Of testtable) = db.GetTable(Of testtable)()
            'getting an exiting row
            Dim objtest As testtable = tbltest.SingleOrDefault(Function(p) p.test_id = Integer.Parse(gdview.DataKeys(e.RowIndex).Value.ToString()))
            If objtest IsNot Nothing Then
                'modifying the row
                objtest.test_cat = DirectCast(gdview.Rows(e.RowIndex).Cells(0).Controls(0), TextBox).Text
                objtest.test_info = DirectCast(gdview.Rows(e.RowIndex).Cells(1).Controls(0), TextBox).Text
                objtest.test_number = DirectCast(gdview.Rows(e.RowIndex).Cells(2).Controls(0), TextBox).Text
                objtest.test_datetime = DirectCast(gdview.Rows(e.RowIndex).Cells(3).Controls(0), TextBox).Text
                'saving rows added
                db.SubmitChanges()
                gdview.EditIndex = -1
                bindgrid()
                ' Me.lblMsg.Text = "Updated Successfully"
            Else
                'Me.lblMsg.Text = "Employee not found"
            End If
        Catch ex As Exception
            'Me.lblMsg.Text = ex.Message
        End Try
    End Using
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:13:58+00:00Added an answer on June 11, 2026 at 9:13 pm

    You can try with

    <columns>
      <asp:templatefield headertext="Test" >
        <itemtemplate>
           .... 
        </itemtemplate>
        <footertemplate>
          <asp:TextBox id="TestTbx"   runat="server"/>
        </footertemplate>
      </asp:templatefield>
    </columns>
    

    Link : http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.templatefield.footertemplate.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have what i hope is a quick question about some code i am
I have a unique requirement that I hope is possible with LINQ to SQL.
Hope you all had a good weekend. We're just about to sign up to
At work I use ClearCase and SourceSafe, but have found some time to do
Good day, I have a simple question (I hope). How do I access the
Hope somebody has a good idea. I have strings like this: abcdefg abcde abc
Hope we have good time.dude i m stuck in a little problem .when i
I hope you have a good morning. I'd like to use jqGrid in my
My problem (and solution?) is simple - I hope :) I have a RIA
I'm trying to learn WPF, so here's a simple question, I hope: I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.