AdvWebGrid questions

Hello,

I started to examine the example from the demos: GridDirectEdit.

There are many points which I do not know how to achieve ...



1. How to switch during runtime the MouseSelect from msSingleCell to msEdit or viceversa ?

   I tried in TIWAdvWebGrid1AsyncEditDone to set it: TIWAdvWebGrid1.MouseSelect := msSingleCell;

   Also in TIWAdvWebGrid1AsyncCellClick TIWAdvWebGrid1.MouseSelect := msEdit; does not work



2. Is it possible to programatically select a specific cell, for example after

   the user finishes editing cell[2,ActiveRow], I need to do some processing on the server-side

   and then cell[5,ActiveRow] should be selected (and be ready for editing) ?



3. How to assign a certain image to a specific row (column9 columntype=ctImage) ?

   I have a "sample.bmp" in my wwwroot-folder and on FormCreate I assign the image:

{code}

procedure TformGridDirectEdit.IWAppFormCreate(Sender: TObject);

var

lp: Integer;

begin

for lp := 0 to 3 do

     TIWAdvWebGrid1.Cells[9,lp] := 'sample.bmp';

end;

{code}



So far I only see a small "x" in column 9, but not my picture.

Any help appreciated.

Additional request:

In the standard Intraweb-grid (TIWGrid) there is HiddenColumns which I found to be very useful.

How could this be achieved for the AdvWebGrid ?

Hi,


1. Asynchronously switching between MouseSelect settings is not supported at this time.
Please use a synchronous refresh instead.

2. Unfortunately it's currently not supported to programatically select a cell.
We'll consider adding this feature in a future version.

3. Your sample code looks OK. Can you please make sure the wwwroot folder is located in the same folder as the application's executable and the filename is correct?

4. You can set Columns[].Visible to False to hide an existing column.

Thanks for your answer!

Points 2,3 and 4 are clarified.

Point 1, using AdvGrid:

The options in AdvGrid are so manyfold - I don't find my way.

What I want to achieve is following:

Typically when the user starts there would be 1 row with mostly empty gridcells.and some non-empty status fields. In all rows there will be about 5 editable cells.

The user clicks on any editable gridcell and then enters some data.

Then I need to do some work on the server-side to check the input.

In a typical setting the input would be an article number (text)

I need to check if this article exists in our database. However the input

could be "123 abc" and the related article could be "123-ABC#XXX"

So the AdvGrid for the corresponding cell would need to be updated to "123-ABC#XXX" thus overriding the input of the user. If the article is not found then an optionlist of possible candidates needs to be presented.

Next input of the user would be typically another gridcolumn for quantity (and after this there would yet be other columns to be decided by the user).

When all input cells are set, then this row is ready to be ordered and another new line with empty input cells is added to the grid (actually there is also an "empty" row in our database created).

So, I don't want to have a row-based input (where the user sets all cells of a row and then the complete row is updated), but I need to check input for each cell and react accordingly)

Is there an example that would closely suit my requirements ?

So far I studied the example for GridDirectEdit but can't get it to behave as I want.

And I need to understand when I should use synchronus events and when can I use asynchronuse events ...

Please help

There are several events available that can be triggered to retrieve cell data depending on the edit mode you are using.

You can try using OnAsyncEditDone, OnAsyncPost, OnPost, OnPostValidate or OnDirectEditUpdate.

Asynchronous events generally provide a smoother and faster experience, however not all actions support asynchronous events. In these case it is required to use synchronous events.