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

  • Home
  • SEARCH
  • 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 6890051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:13:59+00:00 2026-05-27T06:13:59+00:00

I have a datagrid where ten rows will be populated with edit and delete

  • 0

I have a datagrid where ten rows will be populated with edit and delete buttons. When I want to edit a row, the edit button will be changed to save and cancel, but if the user clicks on the delete button, it gives me the error, “object references not set to an instance”. Please let me know how to handle this?

  • 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-27T06:14:00+00:00Added an answer on May 27, 2026 at 6:14 am

    Why dont you just set the “delete button” as disabled while the users edits the entry?
    Then when the user clicks save you enabled it again.
    Like :

    private void btnEdit(object sender, EventArgs e)
        {
            yourmethod();
            btnDelete.Enabled = false;
        }
    

    and then

    private void btnSave_Click(object sender, EventArgs e)
        {
            yourothermethod();
            btnDelete.Enabled = true;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have ten rows on a data grid and I have changed
I have datagrid, when press update button I made popup window. I want to
I have a datagrid getting bound to a dataset, and I want to display
I have a datagrid, populated as shown below. When the user clicks on a
I have a DataGrid, populated with objects in an ArrayCollection. After updating one of
I have a datagrid which is populated with CSV data when the user drag/drops
I have datagrid with paging enabled that can have 10 rows per page. Also
I have a datagrid from which I'd like be able to remove rows at
I have a DataGrid that has between 4-10 columns. I want the columns to
I have a datagrid that allows user to change and save columns widths 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.