* form.init THIS.LockScreen = .t. #DEFINE TAB CHR(9) #DEFINE CRLF CHR(13)+CHR(10) * Data prepare * wait window nowait "Filling cell values..." MCGDATA = "" nCols = fcount() for ix = 1 to nCols MCGDATA = MCGDATA + iif(empty(MCGDATA),"",TAB)+field(ix) endfor MCGDATA = MCGDATA + CRLF scan for ix = 1 to nCols MCGDATA = MCGDATA + iif(ix=1,"",TAB)+nvl(str(evaluate(field(ix))),"") endfor MCGDATA = MCGDATA + CRLF endscan * Data prepare * create cursor foo (gen1 g) append blank append general gen1 class "msgraph.chart" DATA MCGData grType = 1 GrSubtype = 1 THIS.OleBoundControl1.ControlSource = "Gen1" THIS.OleBoundControl1.HasLegend = .t. THIS.OleBoundControl1.autoformat(grType, GrSubtype) THIS.LockScreen = .F.After data is prepared once as you change data in grid all you need is to change corresponding cell in graph.datasheet.
thisform.OleBoundControl1.object.application.datasheet.cells(nRow,nCol).value = nNewValueCetin