Results 1 to 5 of 5

Thread: Datagrid and deletebutton

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62

    Datagrid and deletebutton

    What I wonder is if anyone know if it´s possible to trigger any code Before the row dissapreres.
    I know how to trigger code when the key is pressed etc. But all that code comes after the row is gone in the datagrid.

    Example:
    I want to delete the last row in the datagrid and want to know what rowindex that row got.
    All I get is the index of the row before.

    How should I know if the row that was delteted was the last or the one before?
    //Martin Andersson

  2. #2
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168
    In RowDeletion procedure add one single line before other commands :

    OldRowIndex=Me.DataGrid1.CurrentRowIndex

    'Here OldRowIndex is module level integer variable

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    Thanks.
    But where do I find the function before rowdeletion?
    I have tried to read the row when the key is pressed down but it never enter the function.
    why I don´t know.
    //Martin Andersson

  4. #4
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168
    write in procedure in which you are deleting row (before row-deletion code)

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    deletebutton takes away the post in the datagrid before I can do anything.

    But no probs. I have solved it. Just reloaded the datagrid from the dataset and some checks etc...

    Thanks for responding parminder
    //Martin Andersson

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