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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:46:14+00:00 2026-05-28T00:46:14+00:00

Question should be self explanatory. I have a datagridview which has a column whose

  • 0

Question should be self explanatory. I have a datagridview which has a column whose cells should accept only positive integer upon user input.

So how can I set something like this:

            dgv.Columns[i].ValueType = typeof(int > 0);

??

Of course I can handle a separate validation at cellValueChanged event. But since I have all validation handled in DataError event automatically (since I set valueType for each column), I would like my above validation to be handled here

    private void dgv_DataError(object sender, DataGridViewDataErrorEventArgs e)
    {
        // not fair..
        e.Cancel = true;
    }

How to?

Update: Since I hear a lot of negatives about uint (as proposed by one of the answers) like uints are not CLS compliant, not all language supports it etc, is it ok to use just for validation purpose like above?

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

    The upper part of the question should be easily solved like this:

    dgv.Columns[i].ValueType = typeof(uint);
    

    The lower part I don’t understand at all.

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

Sidebar

Related Questions

The title of this question should be self explanatory, but basically I have this
Recently I have asked a question about what I should use to create self-contained
The title of this question should be pretty self explanatory. I am making an
Well the question is self explanatory! but the thing is I have no experience
Well my question is pretty self-explanatory. I have a class and I want to
The following code should be self explanatory. I have two questions regarding the used
How can I resume a dehydrated orchestration ? the orchestration in question should have
The Title is self explanatory. This was an interview question. In java, List is
I have a question regarding uitable view. I am implementing an app which is
I believe the title is pretty self-explanatory but still, maybe, I should ask in

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.