Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

addition in data grid

Status
Not open for further replies.

akshita

Programmer
Mar 26, 2002
25
0
0
IN
hello friends,

i am having one problem.i want to add new record in between the data grid .i am using adodc control


akshita
 
Hello akshita,
If you r using MS DataGrid 6 (OLEDB), then you must check the "AllowAddNew" check box in the property page for the grid.

Hope this helps

Regards
Mahesh
mshetti@yahoo.com
 
I don't think u can do it using MS DataGrid 6 oledb...Sorry

I also replied ur mail regarding..this is only in case u don't receive the reply

Regards
Mahesh
 
HI akshita,

i don't know any automatic way of doing it, but you can make a cycle like:


Private Sub MSFlexGrid1_Click()
Dim response
Dim row_in_case
Dim i As Integer
Dim j As Integer

row_in_case = MSFlexGrid1.Row
MsgBox "rowe:" & row_in_case
response = MsgBox("would you like to add a new row?", vbYesNo, "your title here")
If response = vbYes Then
With MSFlexGrid1
.Rows = .Rows + 1 ' add a new row

'copy all other rows to next position
For i = .Rows - 1 To 0 Step -1
.Row = i + 1
For j = 0 To .Cols
'copy all cols to next position row in the exact col position
' (...)
Loop
Loop
End With
'now, do whatever you want in the new row - row_in_case:

MSFlexGrid1.Row = row_in_case
' now treat it the way you want

Else
Exit Sub
End If

End Sub


hope it helps,

good work ===================
* Marta Oliveira *
===================
marta100@aeiou.pt
-------------------
CPC_TA- Braga
-------------------
Portugal
===================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top