Refreshing a DataGrid from a DataEnvironment Recordset
Posted on 2000-05-17
I have a DataEnvironment set up and working. I can load the recordset into the DataGrid. Now I want to be able to change the data in the DataGrid. The user selects a menu which changes the SQL statement controlling the recordset behind the DataGrid (The DataSource and DataMember of the DataGrid). I cannot find any way of refreshing the data in the DataGrid.
My Code for one of the menu selections:
strQuery = "SELECT MNAME, MCO, MADDR, MSTRT, MCITY, MPROV, MCNTRY, MPO1, MPO2, " & _
"MGROUP, MID FROM " & coLib & "DT.DTNAME Order By MNAME, MCO"
deAddresses.Commands(1).CommandText = strQuery
I know the query is good, because the only difference between this SQL statement and the initial SQL statement is the Order By clause. The problem is that I cannot get the damn DataGrid to refresh with the new data. However if I select a row in the DataGrid and load it into the editor I've setup I do not get the record shown on the screen. I get the record I'm supposed to get based on the new query. Any help would be appreciated ASAP!