1. DBgrid - Unbound Mode Problem - Urgent!!
I don't know if this is the appropriate Newsgroup for this doubt, if isn't
please accept my appolagies.
I have 2 problems with the dbgrid.
First if I have just one record and made the refresh command the dbgrid
appears with many rows blank!? why can I resolve this? I put the code of the
UnboundReadData, to help you to solve this problem:
Private Sub DBGLinhas_UnboundReadData(ByVal RowBuf As MSDBGrid.RowBuffer,
StartLocation As Variant, ByVal ReadPriorRows As Boolean)
Dim CurRow&, linhas As Integer, Colunas As Integer, LinhassFetched As
Integer, iIncr As Integer
LinhassFetched = 0
If ReadPriorRows Then
iIncr = -1
Else
iIncr = 1
End If
If IsNull(StartLocation) Then
If ReadPriorRows Then
CurRow& = TotalLinhas - 1 'RowBuf.RowCount - 1
Else
CurRow& = 0
End If
Else
CurRow& = CLng(StartLocation) + iIncr
End If
For linhas = 0 To RowBuf.RowCount - 1
If CurRow& < 0 Or CurRow& >= TotalLinhas& Then Exit For
RowBuf.Value(linhas, 0) = Reclinhas(CDbl(CurRow&)).CodArtigo
RowBuf.Value(linhas, 1) = Reclinhas(CDbl(CurRow&)).Designacao
RowBuf.Value(linhas, 2) = Reclinhas(CDbl(CurRow&)).Quantidade
RowBuf.Value(linhas, 3) = Reclinhas(CDbl(CurRow&)).ValorUnitLiq
RowBuf.Value(linhas, 4) = Reclinhas(CDbl(CurRow&)).Iva
RowBuf.Value(linhas, 5) = Reclinhas(CDbl(CurRow&)).Desconto1
RowBuf.Value(linhas, 6) = Reclinhas(CDbl(CurRow&)).Desconto2
RowBuf.Value(linhas, 7) = Reclinhas(CDbl(CurRow&)).TotalLiq
RowBuf.Bookmark(linhas) = CStr(CurRow&)
CurRow& = CurRow& + iIncr
LinhassFetched = LinhassFetched + 1
Next linhas
RowBuf.RowCount = LinhassFetched
End Sub
Second, I'm inserting values in the columns, but if I change to another
control, a button for example, the grid doesn't save the record. Is there
any command that force the dbgrid to do the UnboundWriteData?
Thanks,
Ilidio Pedrosa
2. Help: Update SQL Server Table
3. True DBGrid Pro - Unbound Column in Bound Mode
4. Files CDX
5. Sample code for DBGrid in Unbound mode
6. Where is oledb.lib for HPC platform
7. fill a DBGRID in unbound mode with an array
8. Disconnected Recordset Question
9. fill a DBgrid unbound mode while form loading..
10. dbgrid : unbound mode
11. Need Help in DBGrid using unbound mode
12. Need help with DBGrid in unbound mode
13. Sample code for DBGrid in Unbound mode