How to prevent a clickable cell in a grid refreshing the whole grid

<< Click to Display Table of Contents >>

Navigation:  Forum >

How to prevent a clickable cell in a grid refreshing the whole grid

Forum link

 


 

09-10-2018, 04:15 PM:

 

Hi,

 

It would seem that clicking on a clickable cell in a TIWGrid causes the whole Grid to get refreshed. How do I stop this occurring?

 

Here's how to see my issue:

 

Create a standalone Intraweb applicattion

 

 

 

Drop a TIWGrid onto the form

 

 

 

Add this to the OnCreate of the Form

 

 

 

 

 

Code:

 

procedure TIWForm1.IWAppFormCreate(Sender: TObject);

 

var

 

  i : Integer;

 

begin

 

  IWGrid1.RowCount := 100;

 

  for i := 0 to IWGrid1.RowCount-1 do

 

  begin

 

    iwgrid1.Cell[ i, 0 ].Text := i.ToString;

 

    iwgrid1.Cell[ i, 0 ].Clickable := TRUE;

 

  end;  { for i := Low to IWGrid1.RowCount-1 do }

 

end;

 

 

 

(NOTE: The only reason to add so many rows is so you get a scrollbar)

 

Now run the application and open the browser and scroll down to the bottom of the grid and then click on a cell. The grid will scroll back to the first row which to me makes me think it's been completely refreshed? I'd like for the grid to just stay where it was before I clicked on it.

 

Many thanks in anticipation.

 

Ian.

 


 

09-10-2018, 10:36 PM:

 

Hi there!

 

What does your clickable column do? Does it have an onclick event handler?

 


 

09-11-2018, 07:17 AM:

 

Hi Alexandre,

 

I'm handling the event in the OnCellClick procedure for the Grid. Funnily enough I'm calling NewWindow, the syntax of which you helped me with the other day!

 

Incidentally, if I issue a SendFile instead of a NewWindow the grid does not get re-rendered.

 

Ian.

 


 

09-11-2018, 08:52 AM:

 

Please ignore this question as I've worked around it. Instead of making the cell itself clickable I've assigned a TIWLabel to the cell and added an OnAsyncClick event to this label and this works fine.