I have a small program with a TIWAdvWebGrid, an IWEdit and a IWButton on the form, and with a procedure initializing a grid (deleting all columns and setting RowCount and TotalRows to 0), and based on the result of the SQL Select statement, dynamically creating a grid, showing columns and rows. I use the following select statements: "select * from items where itemname like '%xx%', where xx is the value in the IWEdit1.
When calling then procedure from the IWButton1.OnClick, it work fine and the grid is shown. If I change the SQL query in IWEdit1 and click the button again, the grid is reset and shown, with the values corresponding to the new SQL query.
But when calling the procedure from the IWEdit1.OnAsyncKeyDown event, it don't work. That is, everything IS working, but the grid is not shown.
Debugging shows that the procedure is called and executed (without errors) in both cases and that the only thing happening is that the Grid is not shown, when it is called from IWEdit1.OnAsyncKeyDown event. So even if columns and rows are added, and values are assigned to the various columns and data filled in the various cells without any problem whatsoever, the grid is not shown.
To get around it I have added a IWTimer on the form, set its interval to 50ms, and then enable it for every keydown of the IWEdit1, it works when calling the procedure in IWTimer1.OnTimer event.
So how come the grid is not shown when calling the procedure from The IWEdit1.OnAsyncKeyDown event, but it is shown when calling the procedure from IWButton1.OnClick or IWTimer1.OnTimer events ?
Anybody knows reason and if, do you know any other workaround than the OnTimer event I use ?