Results 1 to 3 of 3

Thread: format datagridview cell

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    format datagridview cell

    As I am typing a value into a cell of the datagridview in winform, I would like to check the value entered.
    For example in a cell of the datagridview I enter 3 and then m
    I basically would like to see if the user has entered m or t and if so multiply the number by 1000000 or 1000 respectively.
    Is there an event to check for the text AS it is being entered into the cell?
    Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: format datagridview cell

    There's a reason that most things don't happen in a DGV until the user changes cells. What happens in your case if the user enters 3, then m, then backspace, then t? You don't know what the user is going to enter until they have finished entering it, so why not wait until then to act on it?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: format datagridview cell

    Is it possible to have a keypress event for only one column of the datagridview?
    Last edited by arkiboys; Sep 28th, 2011 at 01:29 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width