Page 1 of 1

How to refresh grid?

Posted: Wed Mar 31, 2010 5:36 pm
by mol
I want to present some data collected in array with grid.
I want to change some values programmatically.
How to refresh grid to display changes?
Is the only one way to delete all items and add all table rows again?

Re: How to refresh grid?

Posted: Wed Mar 31, 2010 7:51 pm
by srvet_claudio
Hi Mol,

changed the grid with?
<ParentWindowName>.<ControlName>.Cell(nRow,nCol) := CellContent

Do not change directly in the array.

best regards,
Claudio Soto.

Re: How to refresh grid?

Posted: Wed Mar 31, 2010 8:03 pm
by RalphMDS
I am dealing with a similar issue. I am using a grid to display a dbf. I want the user to be able to change the order of the database data (SET ORDER TO TAG...) but when I do this I can't figure out how to get the grid to refresh properly. I have also tried releasing the grid control and then recreating it once the new order is set, but the grid doesn't seem to populate properly. For example, it starts displaying in the middle of the data. It seems the only way to get the data refreshed properly is to click on the data then click a ctrl-end and ctrl-home. Can someone polease give me some guidance on the proper way to do this?

Thanks,

Ralph

Re: How to refresh grid?

Posted: Wed Mar 31, 2010 8:43 pm
by Roberto Lopez
srvet_claudio wrote:Hi Mol,

changed the grid with?
<ParentWindowName>.<ControlName>.Cell(nRow,nCol) := CellContent

Do not change directly in the array.

best regards,
Claudio Soto.
This is.

Re: How to refresh grid?

Posted: Wed Mar 31, 2010 8:45 pm
by Roberto Lopez
RalphMDS wrote:I am dealing with a similar issue. I am using a grid to display a dbf. I want the user to be able to change the order of the database data (SET ORDER TO TAG...) but when I do this I can't figure out how to get the grid to refresh properly. I have also tried releasing the grid control and then recreating it once the new order is set, but the grid doesn't seem to populate properly. For example, it starts displaying in the middle of the data. It seems the only way to get the data refreshed properly is to click on the data then click a ctrl-end and ctrl-home. Can someone polease give me some guidance on the proper way to do this?

Thanks,

Ralph
The thing I've described is different that the Mol one.

Please, post a complete sample to check if this is a bug.

Re: How to refresh grid?

Posted: Thu Apr 01, 2010 7:31 am
by mol
Thanks for help!
I've tried to change my browse control into grid control and I found, that isn't possible to use complex expression as ControlField.

Browse is more flexible - it's possible to use fields from different areas connected via relations, or even use function or expressions as fields...

So, I wanna ask, do you expect such a possibilities, Roberto?

Re: How to refresh grid?

Posted: Thu Apr 01, 2010 8:11 am
by sudip
When I want to refresh a grid using tables (.dbf), I use refresh method of grid. Eg.,

Code: Select all

   select salreg
   delete all
     
   select emp
   go top
   do while !eof()
      select salreg
      append blank
      replace ...
      replace ...
            
      select emp
      skip
   enddo
   
   frmSalreg.grdSalreg.Refresh  //------ grdSalreg grid uses salreg table         
Here both "emp" and "salreg" are temorary tables, created with SQLMIX RDD.
With best regards.
Sudip

Re: How to refresh grid?

Posted: Thu Apr 01, 2010 2:31 pm
by Roberto Lopez
mol wrote:Thanks for help!
I've tried to change my browse control into grid control and I found, that isn't possible to use complex expression as ControlField.

Browse is more flexible - it's possible to use fields from different areas connected via relations, or even use function or expressions as fields...

So, I wanna ask, do you expect such a possibilities, Roberto?
Yes, of course. Data-bound grid will continue evolving.

Re: How to refresh grid?

Posted: Thu Apr 01, 2010 4:52 pm
by Roberto Lopez
RalphMDS wrote:I am dealing with a similar issue. I am using a grid to display a dbf. I want the user to be able to change the order of the database data (SET ORDER TO TAG...) but when I do this I can't figure out how to get the grid to refresh properly. I have also tried releasing the grid control and then recreating it once the new order is set, but the grid doesn't seem to populate properly. For example, it starts displaying in the middle of the data. It seems the only way to get the data refreshed properly is to click on the data then click a ctrl-end and ctrl-home. Can someone polease give me some guidance on the proper way to do this?

Thanks,

Ralph
I've created a sample to test Grid with multiple orders and I've confirmed the problem.

The problem is caused by an speed optimization.

I'm working to fix it.

Thanks for the report.

Re: How to refresh grid?

Posted: Thu Apr 01, 2010 7:09 pm
by Roberto Lopez
Roberto Lopez wrote: I've created a sample to test Grid with multiple orders and I've confirmed the problem.

The problem is caused by an speed optimization.

I'm working to fix it.

Thanks for the report.

I've fixed.

A patch including a sample is attached to this message.

Thanks again for the report.