Filter a DataGrid.
Posted: Mon Aug 04, 2014 5:24 pm
this isnt a question, if anyone want to filter a datagrid her's what i did.
Filter button code:
Refresh button code:
Filter button code:
Code: Select all
on mouseUp
lock screen
send dbConnect to me -- Populates the DataGrid with data
put the dgData of group "DataGrid" into theDataB -- Puts the data of the DataGrid into a variable
put the dgIndexes of group "DataGrid" into theIndexes -- Puts the Indexes of the DataGrid into a variable
repeat for each item theIndex in theIndexes
if theDataB[theIndex]["People"] contains field "filter" or theDataB[theIndex]["Country"] contains field "Filter" then -- If Array "People" or "Country" contains any of the text in field "filter" then it populates the DataGrid with this data
put theDataB[theIndex]["People"] after theDataC[theIndex]["People"]
put theDataB[theIndex]["Country"] after theDataC[theIndex]["Country"]
end if
end repeat
set the dgData of group "DataGrid" to theDataC
unlock screen
end mouseUp
Code: Select all
send dbConnect to me