Bonjour,
J'utilise un XStringGrid contenant un comboCellEditor , pour mettre à jour mes données , j'ai besoin de pouvoir récupérer le numéro d'index de l'item sélectionné.
Pour ce faire je récupère le comboCellEditor grâce à la propriété Editor de la TXCollumns. Or, cela ne marche pas j'ai toujours un EAccessViolation.
quelqu'un aurai t il une autre idée ?

Merci d'avance ...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
procedure TFormConfigSNMP.sgEquipementRegistresSetEditText(Sender: TObject;
  ACol, ARow: Integer; const Value: string);
var
  grid : TXStringGrid;
  config : pConfigRegistre;
  combo : TcomboCellEditor;
begin
 
  grid := TXStringGrid(Sender);
 
  // Récupération du bon registre à configurer
 
  config := ModuleSNMP1.ConfigurationGeneral
              .Parametres
              .ConfigurationAgents
              .GetConfigAgent(lstConfigAgent.items[lstConfigAgent.ItemIndex])
              .registres.GetValue(ARow -1 );
 
  config.designation_registre := grid.Cells[0,ARow];
  config.nom_mib := grid.Cells[1,ARow];
  config.oid := grid.Cells[2,Arow];
 
  combo :=  TCombocellEditor(grid.Columns[2].Editor);
  showmessage (combo.Items.Text);
...