Reading values of combined cells with html

Dear sirs,

I have to program an article list for different article groups / machine types and want to use your AdvWebGrid component for this. I have to combine one or more lines of text, a link to some documentation and / or a checkbox with a default quantity value in each cell. This can easily be done using html code (got this from SelftHTML):

Grid1.Cells[1,1] := '<a href="Info.pdf" target="_blank">2030410034 trigger</a><br><input type="checkbox" name="qty1" value="16">Default Quantity 16<br>';

I know this is not a TMS problem but perhaps you are so kind to help me anyway: when the user presses the "add to basket" button, how can I read out wether the "qty1" Checkbox is checked or not? And would it be possible to add an editable editbox with the desired quantity, which would be filled with "16", when the checkbox is checked? (or a similar function)

Many thanks in advance; perhaps some other users of your grid component could find this helpfull too

Greetings
Detlev

Have you thought about adding one or two extra columns to the IWAdvWebGrid?

One with a CheckBox and one with an EditBox (possibly Dyn* type Columns).

This way you should be able to retrieve the extra information server-side.

Uh, this is a good idea - will try it!

Thx
Detlev

Dear Bart,

I spoke with my customer and using other columns for editing is not a good way to implement the desired functionality. I than had the idea to use a ctLink column for putting articles in the shopping car.

BUT: Only in special rows the column should be working as a link; here an example

Machine Type | PART LIST 1   | PART LIST 2   | ...
Machine 1    | no. 123       | no. 4711      |
Typ 1        | textfield     | textfield     |
Vers. 1      | Qty 10 (Link!)| Qty 3 (Link!) |
Sernr 34434  |               |               |
             | no. 5544      |               |
             | textfield     |               |
             | Qty 5 (Link!) |

So in this example only the rows 2 and 6 (in columns 1 and 2) should be ctLink type, all other cells are ctNormal

I thought I could use the OnGetCellType event for this, but it does not work - whats wrong in my code?

procedure TfrmOLK.Grid1GetCellType(Sender: TObject; RowIndex,
  ColumnIndex: Integer; var AColumnType: TTIWColumnType;
  var Editor: TTIWColumnEditor; var DynEditor: TTIWDynEditType);
begin
  if ColumnIndex > 0 then // not the first column ...
  begin
    case RowIndex of
    2,6: AColumnType := ctLink;
    end;
  end;
end;

I set the cell values in the "FormRender" event and want to use one "OnLinkClick" event to be informed, when the user clicks one of the "Qty xxx" links.

Many thanks in advance
Detlev

I have not been able to reproduce this issue.

Your code and the OnGetCellType / OnLinkClick events are working as expected.
Can you please explain exactly what is not working?

If the problem persists, please provide a ready to use sample project that demonstrates the issue so I can further investigate this.
Can you also let me know which version of Delphi and IntraWeb you are using?

Oh no - I checked my app again and I had not in mind that row numbers start with zero!!

Sorry, my fault - now it works as expected!

greetings
Detlev