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 345357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:04:35+00:00 2026-05-12T11:04:35+00:00

I am using C#.net I want to add custom edit/delete buttons to my GridView1

  • 0

I am using C#.net

I want to add custom edit/delete buttons to my GridView1 (one edit/delete button per row).

However I want the buttons to access another view (editView/deleteView within the same form), rather than edit ‘inline’ etc.

The edit button seems to be working fine. Here’s how I created it manually:

Right clicked on GridView1
Clicked on ‘Add New Column’
Field Type: ButtonField
Header Text: Edit
Button Type: Button
Command Name: Edit
Text: Edit

Within the ‘Events’ section (located under properties) for GridView1, I double clicked on the RowEditing, this then created a Event I could access within the code behind.

    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        // Access _viewAdd

        _multiView1.ActiveViewIndex = 1;
   }    

The delete button should access the deleteView (confirmation page) rather than just automatically deleting a row. I want to create a custom method that is triggered when the user selects the delete button.

  • 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-05-12T11:04:35+00:00Added an answer on May 12, 2026 at 11:04 am

    I ended up using a repeater and amending both a edit/delete button onto the end of each row. These button not only held the OnClick_Event information but also the ID associated with that row.

          <asp:Repeater ID="Repeater" runat="server" DataSourceID="*****">
            <HeaderTemplate>          
              <table cellpadding="3" cellspacing="3">
                <tr>
                  <th style="text-align:left">Name</th>
                  <th>&nbsp;</th>
                  <th>&nbsp;</th>
                </tr>            
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                  <td style="text-align:left"><%#Eval("forename")%>&nbsp;<%#Eval("surname")%></td>
                  <td style="text-align:left"><asp:Button ID="edit" OnCommand="edit_Click" CommandArgument='<%#Eval("id")%>' runat="server" Text="Edit" CssClass="standardButton" /></td>
                  <td style="text-align:left"><asp:Button ID="delete" OnCommand="delete_Click" CommandArgument='<%#Eval("id")%>' runat="server" Text="Delete" CssClass="standardButton" /></td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
              </table>
            </FooterTemplate>
          </asp:Repeater>
    

    I hope that helps other people.

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

Sidebar

Related Questions

I'm using .NET 2.0 Windows Forms and want to add drawing components such as
Using C# in .Net 2.0 When someone joins my server, I want to add
Using VB.NET I want to display the date in datetimepicker from the database. Code.
Using VB.Net I want to get a all datagrid cell values, then insert into
Using vb.net 2008 I want to display a table in the form, so i
Using C# ASP.NET I want to program a queue. I want to have X
Using .net 2.0 . I want to display a column in a DataGridView as
using .NET 3.5. I have a function I want to make multithreaded calls to.
I am using ASP.NET and I want to create a barcode in a pdf
I want to develop a client-server based desktop application using .Net 4, C# and

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.