Embedding NumericUpDown Controls in a DataGridView using Visual Basic

jpcodex153 20 Reputation points
2023-06-13T20:08:14.2+00:00

I'm trying to create a DataGridView column that has a NumericUpDown control for each row. However, I want to also control each NumericUpDown properties individually. For example, the numeric control on row one I want the following properties ".DecimalPlaces = 2, .Increment=1.0, .Minimum=-100.0, .Maximum=100.0". On Row two I want the following properties ".DecimalPlaces=3, .Increment=.1, .Minimum=0, .Maximum=10.0". I don't want to hard code the properties either, because I will be reading from a database what these properties and then adjusting the form dynamically. I am using Visual Basic 2022.

Thanks for any help in advance...

Developer technologies .NET Other
Developer technologies VB
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2023-06-15T06:23:35.5033333+00:00

    Hi @jpcodex153 ,

    You can refer to the document Build a Custom NumericUpDown Cell and Column for the DataGridView Control.

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.