Jump to content

DBGRID Action Columns at Design Time

Recommended Posts

Variant of the component Tunidbgrid with Columns Action At design time. 
This new component is the result of a collaboration between myself and Mr. Maikel Bresler. 
the component has been tested with version 0.96... of UniGui and Delphi XE3. 
I do not think that there are problems with other versions of Delphi. 
package BMUiniDbGrid;
  UniGUI17;   // unigui17 = delphi XE3    >>>  Change the package Unigui17 with your version of Delphi                 
Build and install the  package BMuniDBGrid.dpk 
Add the Path (dcu) in Delphi>Tools>Delphi Options>Library 
Have Fun. 
P.Š. if you need a demo program, please let me know. 
with best regards 
Salvatore Marullo






  • Like 1
  • Upvote 7
Link to comment
Share on other sites

Hi Csyasar, 
Tunistrings (I believe) is defined Uniguitypes.dcu also in Delphi10. 
Only for a test, 
Please copy UniguiTypes.dcu from ... \ FMsoft \ Framework \ unigui \ dcu \ delphi10 
in the directory where the package BMuniDBGrid.dpk is located. 
Build and install the package. 
Is working, you have a problem with delphi path: in Delphi see Tools.Options.Delphi Options.libary




Salvatore Marullo

Link to comment
Share on other sites

  • 4 weeks later...



I try to get it run without success. I've installed the TBMDBUniGrid without problems. I followed the pictures in the forum post to set up a button column. On Runtime, i can see the button column, thats fine. But if click on it, the OnButtonAction is never fired. I leave the OnActionColumnEvent property blank. maybe that is the problem?


Maybe a little demo program would help me.


Thanks in advance

Link to comment
Share on other sites

Hi Kiener , 


yes, this is the problem. 

at the moment  are busy . 


Later   I will post  you a demo. 








procedure TMainForm.gridButtonAction(Sender: TObject; ButtonEvent: string);
   memo.Lines.Add('Clik :  ' +  ButtonEvent )  ;
Link to comment
Share on other sites

Hi rullamore,


First i have to thank you for the quick demo. I studed it and saw... there is no difference to my project. Hmm... the only difference was, that my grid was on a TuniPanel. So i set the grid directly to the form and.. it works!

So i changed your demo project in that way. I placed a TuniPanel on the form and set the grid into it. Now, even the demo project did not fire the OnButtonAction event.


Seems to be an issue.



Link to comment
Share on other sites

Hi ganzqgy, 


Not tested in Delphi XE2. 
Maybe you can help.
procedure TBMUniDBGrid.JSEventHandler(AEventName: String;
  AParams: TUniStrings);
    Vals: String;
    ArrayOfIndex: TArray<String>;
    I: Integer;
    CurrentPos: TBookmark;
    var Ts : Tstrings ;  // New XE2
    x         : integer ;   // New XE2
  if SameText (AEventName,FActionColumnEvent)  then begin
      if assigned(Self.OnButtonAction) then
      self.OnButtonAction(self,AParams.Values['Buttons']) ;
  else  if SameText (AEventName,'SelectedRows') then begin
        SelectedRows := strtoint(AParams.Values['RowsCount']);
          SelectedRows := 0 ;
  else if  sametext(AEventName,'selectionchange') then
    Self.FSelectionListObject.RawValueOfIndex := AParams.Values['ArrayOfIndex'];
    Vals := Self.FSelectionListObject.RawValueOfIndex;
    // Vals := Vals.Replace('[', '');
    // Vals := Vals.Replace(']', '');
    Vals :=   StringReplace( Vals, '[', '', [RfReplaceAll] );    // XE2
    Vals :=   StringReplace( Vals, ']', '', [RfReplaceAll] );    // XE2
   // ArrayOfIndex := Vals.Split([',']);
 // XE2 
    Ts := Tstringlist.Create ;
    ts.Delimiter := ',' ;
    ts.DelimitedText := Vals ;
   SetLength(ArrayOfIndex, ts.Count);           //   added by mr. ganzqgy  




    for x  := 0 to ts.Count- 1 do begin
      ArrayOfIndex[x] := ts.Strings[x] ;
  // XE2














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.

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...