AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein runtime popupmenu on specific TDBGrid cell
Thema durchsuchen
Ansicht
Themen-Optionen

runtime popupmenu on specific TDBGrid cell

Ein Thema von question · begonnen am 24. Sep 2013 · letzter Beitrag vom 25. Sep 2013
 
question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#1

runtime popupmenu on specific TDBGrid cell

  Alt 24. Sep 2013, 21:30
Hi
Since few days,i am trying to solve one problem, but still now not suscess I have a TDBGrid: DBGrid1, i want to create runtime cotext menu by right mouse click on the grid cell. For example, if i right click on the DBGrid cell then it will check the value of the selected cell and if the value is true only then it will show the popup menu
i cannot use any event handler(onmouse up or on mousedown or onclick), its possible to create the popupmenu 'onshow event' using the following code but then it shows the popupmenu everywhere i click on the DBGrid but i want to show the popup menu on specific cell,could anybody please tell me, how to do it?
Code:
procedure TForm2.FormShow(Sender: TObject);
var
NewPopup: TPopupmenu;
MenuItem: TMenuItem;
begin
// i have tried here to set the condition, for example:
//s := DBGrid1.DataSource.DataSet.FieldByName('tutorial_id').AsInteger;
if s=10 then // but it does not work
NewPopup := TPopupMenu.Create(nil);
MenuItem := TMenuItem.Create(NewPopup);
MenuItem.Caption := 'Send-Click';
NewPopup.Items.Add(MenuItem);
DBGrid1.PopupMenu := NewPopup;
end;

Geändert von question (25. Sep 2013 um 08:07 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:39 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz