How to refresh grid?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

How to refresh grid?

Post 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?
User avatar
srvet_claudio
Posts: 2224
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: How to refresh grid?

Post 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.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
RalphMDS
Posts: 21
Joined: Wed Mar 25, 2009 1:24 pm
Location: New Jersey, U.S.A.

Re: How to refresh grid?

Post 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
When your toolbox only contains a hammer, everything looks like a nail...
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: How to refresh grid?

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: How to refresh grid?

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How to refresh grid?

Post 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?
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to refresh grid?

Post 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
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: How to refresh grid?

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: How to refresh grid?

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: How to refresh grid?

Post 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.
Attachments
patch3.0.27b.rar
(206.14 KiB) Downloaded 342 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply