Datagrid issue to add a (multiple) Line(s)
Posted: Tue Mar 08, 2016 4:35 pm
Hello,
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:
i can add data and in the last column even multiple lines even with enter
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:
i can add a new line to the datagrid but i can't do the multiple line
i've added a little code to the datagrid that displays the multiple lines in a separate field when clicking on the line:
How can i correct the first script so that it does add a line to the grid. it now seems to refresh the whole grid.
thanks for any help on this.
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.