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. ![]()
Thanks for answer
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. ![]()
Thanks for answer
Posted 22 October 2015 - 02:08 PM
Posted 22 October 2015 - 02:23 PM
Hi,
You are so fast for reply. ![]()
But when i try set all cells in column to .empty:=true nothing happened.
Buttons are stil visible.
Any other solution? ![]()
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;
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;
![]()
0 members, 1 guests, 0 anonymous users