|
-
Oct 10th, 2002, 11:18 AM
#1
Thread Starter
Lively Member
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
-
Oct 10th, 2002, 11:22 AM
#2
PowerPoster
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....
-
Oct 10th, 2002, 11:34 AM
#3
Thread Starter
Lively Member
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?
-
Oct 10th, 2002, 11:41 AM
#4
PowerPoster
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....
-
Oct 10th, 2002, 11:44 AM
#5
Thread Starter
Lively Member
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.
-
Oct 10th, 2002, 11:49 AM
#6
PowerPoster
Well
Assumptions : Connection and recordset established
VB Code:
Dim INTNEXT As Integer, INTMAX As Integer, MYDATA As String
INTMAX = rst.RecordCount
If INTMAX > 0 Then
For INTNEXT = 1 to INTMAX
MYDATA = _
rst!FIELD1 & VBTAB & _
rst!FIELD2 & VBTAB & _
rst!FIELD3
MsFlexGrid1.AddItem MYDATA
' Move to next record
rst.MoveNext
Next
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....
-
Oct 10th, 2002, 11:54 AM
#7
Thread Starter
Lively Member
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)
-
Oct 10th, 2002, 01:10 PM
#8
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|