Jump to content

UniPopupMenu in niDBGrid in Runtime


Ario.Paxaz

Recommended Posts

Hi

 

I use below Code,for create UniPopupMenu in UniDbGrid in Runtime,But don't work.what's my error?

procedure TMainForm.UniDBGrid1CellContextClick(Column: TUniDBGridColumn; X,Y: Integer);
Var
  MyUniPopupMenu:TUniPopupMenu;
  i: SmallInt;
  MI: TuniMenuItem;
  AGrid:TUniDBGrid;
  Aagrid:TComponent;
begin
  Aagrid:=Column.Grid;
  AGrid:=FindComponent(Aagrid.Name) as tunidbgrid;
  MyUniPopupMenu:=TUniPopupMenu.Create(AGrid);
  MyUniPopupMenu.Popup(X,Y);
  For i := 0 To 3 do
  Begin
    MI := TuniMenuItem.Create(AGrid);
    MI.Name := AGrid.Name + 'MI' + IntToStr(i);
    MI.Caption:='s'+IntToStr(i);
    MyUniPopupMenu.Items.Add(MI);
  End;
end;

Best Regards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...