Results 1 to 2 of 2

Thread: DataGridView - Intercepting the adding of rows

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    DataGridView - Intercepting the adding of rows

    I see the DataGridView control has a property "AllowUserToAddRows" that I can turn on or off but what if I want the ability to be context dependent.

    i.e. I want an event that will fire when the user attempts to add a row in which I can cancel if certain conditions aren't met but I can't find an appropriate event.

    Any ideas on how to do this?
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: DataGridView - Intercepting the adding of rows

    Check out Beth Massi example for your issue where she does validation for adding and editing using a partial class to a dataset to enforce validation rules.

    http://msdn.microsoft.com/en-us/vbasic/bb643821.aspx

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