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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:29:56+00:00 2026-05-27T11:29:56+00:00

I color invalid data red in a DataGridView. After the user makes changes, I

  • 0

I color invalid data red in a DataGridView. After the user makes changes, I would like to just reset all formatting back to default so I can look for errors and mark them red again without having to worry about which cells have been fixed and need to be set back to normal.

Is there a quick/easy way to do this without resetting the datasource?

Thanks!

Edit: Guess I didn’t communicate clearly enough. It’s an import app that moves data from a csv file into a sql table. I put the csv data into the dgv and verify that it’s not going to cause any errors before importing (i.e. wrong data type or data is too long) and mark those cells red if so.

They hit a ‘verify data’ button to run this process before importing and when they hit it again I just want to clear the formatting and start over.

  • 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-27T11:29:57+00:00Added an answer on May 27, 2026 at 11:29 am

    I ended up doing the following:

    var ds = dgv.DataSource;
    dgv.DataSource = null;
    dgv.DataSource = ds;
    

    That caused all the formatting to go back to default values like I wanted without having to reload my data. If there’s some property or other better way to do this that I’m overlooking though then put it on here so I can mark it as a better answer.

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

Sidebar

Related Questions

Given a source color of any hue by the system or user, I'd like
I am making a Color class, and provide a standard constructor like Color(int red,
An RGB color is composed of three components: Red (0-255), Green (0-255) and Blue
How does one make a textbox highlighted with red color when an event occurred
I have a byte array which I would like to access by Int32 pointer
I am working on PHP and databases for an assignment and I would like
How should I mark input fields as invalid (i.e. color, background-color, border, etc.) Currently,
Does anyone know how to reset the border color of an input control once
I'm getting an 'Invalid XML Data' error for any Fusion Chart which contains a
jQuery.validate doesn't seem to change the background color of the invalid element by default.

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.