Results 1 to 8 of 8

Thread: remove row from datagrid

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    102

    remove row from datagrid

    Can anyone help me with code for removing the selected row from a datagrid. I cant seem to find the the right method.

    If the datagrid is connected to a datasource, will it also remove it from the recordset? Ideally I would like it to be removed from the recordset but not from the database

    All help welcome

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    If you are not looking for in grid editing... why not use a flexgrid control? This way you do not have to do the binding, and you could remove item from the grid, but not necessary from the database itself...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    102
    I liked the DAtagrid because of the datasource (ie it will self populate)

    How hard is it to populate a flexigrid from an ADO.Recordset?

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Originally posted by darthy
    I liked the DAtagrid because of the datasource (ie it will self populate)

    How hard is it to populate a flexigrid from an ADO.Recordset?
    Not real hard. How many records are we taliking about?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    102
    Depends. It will be used to display a type of shopping basket where the client will have theoption to remove an item from it.

    Anything from 1 to say 30 rows.

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Assumptions : Connection and recordset established

    VB Code:
    1. Dim INTNEXT As Integer, INTMAX As Integer, MYDATA As String
    2.  
    3. INTMAX = rst.RecordCount
    4.  
    5. If INTMAX > 0 Then
    6.  
    7. For INTNEXT = 1 to INTMAX
    8.  
    9. MYDATA  = _
    10. rst!FIELD1 & VBTAB & _
    11. rst!FIELD2 & VBTAB & _
    12. rst!FIELD3
    13.  
    14. MsFlexGrid1.AddItem MYDATA
    15.  
    16. ' Move to next record
    17.  
    18. rst.MoveNext
    19.  
    20. Next
    21.  
    22. End If

    That's a basic way of loading a handful of items into an grid...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    102
    When trying to connect to the adocontrol on my form it displays error- No compatible data source was found for this control. PLease add intrinsic Data Control or Remote Data Control.

    Is the flexigrid not compatible with the ADODC?

    PLease forgive my ignorance if this is a dumb question but I am a beginner (Sorry)

  8. #8
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    The method I was mentioning does not utilize data-binding controls. You wuld have to make the connection and recordset in code, rather than utilizing those damsn data-bound controls (can you telll I do not like those controls much )
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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