Results 1 to 5 of 5

Thread: Datagrid - Deleting Rows

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2004
    Location
    Lagos, Nigeria
    Posts
    215

    Datagrid - Deleting Rows

    Does any body know how to prevent a user from deleting rows from a datagrid?

  2. #2
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    set the 'ReadOnly' property to True.

    but this will also restrict the user to add any new records.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2004
    Location
    Lagos, Nigeria
    Posts
    215
    i know about the readonly property.

    i want a situation whereby if rows are selected, and delete button on the keyboard pressed, the rows will not be deleted.

  4. #4
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    Then, on the KeyDown event of ur grid, check if the row is selected and if Del. key is pressed. If so, then set the e.Cancel to True.

    Hope it helps

  5. #5
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416
    or make a datagridtablestyle and set the textbox.enable = false..

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