i'm fighting with a little problem it seems, but i'm unable to solve.
a little help will be appreciated
when adding some data to a datagrid i get different out comes.
with this:
Code: Select all
put the dgNumberOfLines of grp"DataGrid 1" into theLineNo
add 1 to theLineNo
put theLineNo into theDataA[theLineNo]["Nr"]
put tFileSec into theDataA[theLineNo]["Model"]
put fld"fouttitelnew" into theDataA[theLineNo]["Fout"]
put fld"oplossingnew" into theDataA[theLineNo]["Oplossing"]
set the dgData of group "DataGrid 1" to theDataA
but i can not add add a new line below or above the existing line, it updates the current line
This is what i want to use but then with more lines in the datagrid
with this:
Code: Select all
put the dgNumberOfLines of group "DataGrid 1" + 1 into theLineNo
put theLineNo & tab & tFileSec & tab & fld"fouttitelnew" & tab & fld"oplossingnew" into theRowData
put "Nr" & cr & "Model" & cr & "Fout" & cr & "Oplossing" into theDataColumns
dispatch "AddLine" to group "DataGrid 1" with theRowData, theDataColumns, theLineNo
i've added a little code to the datagrid that displays the multiple lines in a separate field when clicking on the line:
Code: Select all
on mouseUp pBtnNum
if pBtnNum is 1 then
put empty into fld"showsolution"
put the dgHilitedLines of group "DataGrid 1" into theLine
put the dgDataOfLine[theLine] of group "DataGrid 1" into theDataB
## theDataB is now an array variable.
## In the case of the Data Grid pictured above the keys of the array are id, FirstName, LastName and Title.
## This answer dialog will display: Dusty Bottoms
#answer theDataB["Nr"] && theDataB["Model"]&& theDataB["Fout"]&& theDataB["Oplossing"]
put theDataB["Oplossing"] into fld"showsolution"
end if
end mouseUp
thanks for any help on this.