Topic: Memo Popup on Grid?
I was trying to add memo display on grid using mousedown event.
Found the following code from Dmitry for one of Derek's project:
procedure Form1_TableGrid1_OnMouseDown (Sender: string; MouseLeft, MouseRight, MouseMiddle: boolean; Shift, Alt, Ctrl: boolean; X, Y: Integer);
begin
form1.memo1.Text := sqlexecute('select message from phonecalls where id =' +inttostr(Form1.TableGrid1.dbIndexToID(Form1.TableGrid1.GetRowAtPos(x,y))));
form1.panel1.Visible := true;
end;
It works fine but when clicked on grid where a row doesn't contain data; it produces "List index out of bounds" message. Is there a way to eliminate it?
God... please help me become the person my dog thinks I am.