Elwin
  • Elwin
  • Newbie Topic Starter
2022-06-07T15:30:16Z
Hello,

I have IGrid 7.5 and on a Excel Form I have 2 buttons that each load a separate SQL query from our database (I'll call them Q1 and Q2). These queries then populate the IGrid. Both SQL queries have a number of field names that match the fieldnames. The weird thing is, when I run Q1, all fields are loaded correctly. If I then run the button of Q2 then the SQL is loaded, but all field names that are not in Q1 are blank while the SQL gives me data in MS Management Studio?

If I do it the other way around, first load Q2 I get to see all the fields again and when I then run Q1, it again only loads the query with the same field names as Q2 and the "new" fields based iin Q1 are blank again.

I've also tried applying iGridResults.Clear bRemoveCols = True but this doesn't solve the problem. So my question is is there another way to completely reset the IGrid for loading a complete new querie?

It looks like the IGrid keeps the field names or something in its memory?
Igor/10Tec
2022-06-08T07:59:34Z
If we are talking about the FillFromRS method, its default behavior is to use the existing column set to populate iGrid. If iGrid has some columns, their keys are used to show the corresponding fields from the recordset. Thus, if you load Q2 after Q1, you will have the columns remaining from the previous population from Q1. This default behavior of the FillFromRS method can be changed with its optional second parameter called eMode. See the full description in the help file.

However, we can't understand why removing columns with the Clear method does not help to solve the problem. FillFromRS uses only the columns you can create/remove yourself and does not cache any other information. Can you send us a sample demonstrating this issue?
Elwin
  • Elwin
  • Newbie Topic Starter
2022-06-08T15:14:19Z
Hello thanks for your answer. I have tested the emode function but did doesn’t change anything. I cannot send you an example because it is connected with our local SQL database which will not work from outside? What I can do is giving you access by teamviewer so I can show you directly? Send me an PB if you want access so we can connect?
I also made a short video but I cant upload it in zip format? Can I send you these by email?

What you see is that when I push the blue button (which is Q1) than fields are loaded. When I push orange button some of the fields are empty. If I start up the Form again but push first Orange (Q2) button it will load all fields but after pushing button blue some of the fields are empty?
Igor/10Tec
2022-06-08T16:45:21Z
The email address of our support service can be found on the Contacts  page.

Send us your code that demonstrates how you populate and repopulate iGrid with Q1 and Q2. It will not execute without your database, but it may help us to understand what is going on.

You can also record a video and upload it to a cloud. Create a link to it, don't send huge video files in an email.
Elwin
  • Elwin
  • Newbie Topic Starter
2022-06-10T07:43:15Z
Thanks for your reply now I understand what I did wrong. I tried to use iGrid.Clear but didn’t notice that (TRUE) is necessary. After add this it works perfect now so thanks! So the rigth way to clear the grid is : iGrid.Clear (TRUE)