Jump to content


Photo

NxToolbarColumn

NxToolbarColumn

  • Please log in to reply
4 replies to this topic

#1 HotICE

HotICE
  • Members
  • 3 posts
  • Gender:Male
  • Location:Czech Republic

Posted 22 October 2015 - 02:05 PM

Hello,

 

is possible show buttons in NxToolbarColumn in TNextGrid only on selected row?

I cant find any solution for this.

I want 4 buttons and when I list all my records in grid it look very strange. There are too much buttons. :rolleyes:

 

Thanks for answer



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 22 October 2015 - 02:08 PM

Hi,

I think that maybe .Empty property of Cell can help.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 HotICE

HotICE
  • Members
  • 3 posts
  • Gender:Male
  • Location:Czech Republic

Posted 22 October 2015 - 02:23 PM

Hi,

 

You are so fast for reply. :rolleyes:

 

But when i try set all cells in column to .empty:=true nothing happened.

Buttons are stil visible.

 

Any other solution? ;)



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 22 October 2015 - 02:38 PM

Hi,

 

And also set HideWhenEmpty property of Column. Sorry for I forgot this.

 

procedure TForm1.Button1Click(Sender: TObject);
begin
  NextGrid61.Cell[1, 1].Empty := True;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  NextGrid61.AddRow(5);
  NxToolbarColumn61.HideWhenEmpty := True;
end;

boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 HotICE

HotICE
  • Members
  • 3 posts
  • Gender:Male
  • Location:Czech Republic

Posted 22 October 2015 - 04:06 PM

thank you for direction to solve my problem.

 

Here is final code:

procedure TForm1.FormCreate(Sender: TObject);
var aC,aR:integer;
begin
  for aC := 0 to 4 do begin
    myGrid.AddRow();
    aR:=myGrid.LastAddedRow;
    myGrid.Cell[colBtn.Index,aC].Empty:=true;
  end;

  colBtn.HideWhenEmpty:=true;
end;

procedure TForm1.myGridBeforeSelect(Sender: TObject; var ACol, ARow: Integer;
  Key: Word; Shift: TShiftState);
begin
  if(myGrid.SelectedRow<>-1)then begin
    myGrid.Cell[colBtn.Index,myGrid.SelectedRow].Empty:=true;
  end;
end;

procedure TForm1.myGridSelect(Sender: TObject; ACol, ARow: Integer);
begin
  myGrid.Cell[colBtn.Index,myGrid.SelectedRow].Empty:=false;
  myGrid.Repaint();
end;

:rolleyes: :) B)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users