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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:37:03+00:00 2026-05-15T00:37:03+00:00

My DataSource is a DataTable populated from file system data in Page_Load. There is

  • 0

My DataSource is a DataTable populated from file system data in Page_Load. There is no database. How can I remove rows from the DataTable and rebind? I thought this had to be done in the GridView_RowCommand “Delete” section…

if(e.CommandName == "Delete")
    ...

When I try to access the DataRow’s within

//get the datatable
DataTable dt = this.gridCPCP.DataSource as DataTable;

// Delete the record 
foreach (DataRow dr in dt.Rows)
{
    ....

dt is null. How do I reference the DataTable when deleting records?

  • 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-15T00:37:04+00:00Added an answer on May 15, 2026 at 12:37 am

    e.CommandArgument should give you the index of the row which should be deleted.
    You could bind your datatable to the grid again without the deleted item.

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

Sidebar

Related Questions

my dropdownlist is populated from the database as in: DataTable dt = GetData(); ddlMylist.DataSource
This is what I am trying to achieve: DataTable populated using data from non
On a winform there is a combobox that derives its information from a datatable.
A few days back I had to de-serialize data from xml file to my
I have a drop down list populated from a database. When i use the
I'm using a System.Windows.Forms.DataGrid. It is populated with about 3000 rows and redraws very
I have a DataViewGrid I populated from a DataTable in a query to a
I have a custom GridView Control where I grab data from the database to
I am using currently the following code to populate a combobox: combobox.DataSource = datatable;
I have a ListBox (LB) with a DataTable (DT) DataSource in the Form Class

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.