How to hide columns in cell detail form ?
Hi,
How to hide columns in cell detail form ?
I would like to hide columns directly on the double click event.
I find no examples.
thanks
How to hide columns in cell detail form ?
I would like to hide columns directly on the double click event.
I find no examples.
thanks
Comments
Support response :
Add fcxDetailGrid in uses.
Hi.
Standard code:
procedure TfcxSliceDataZone.DblClick(X, Y: Integer);
var
DataPoint: TfcxDataPoint;
begin
DataPoint := PointToDataPoint(Point(X, Y));
if Assigned(Grid.OnDataDblClick) then
Grid.OnDataDblClick(Self, DataPoint.x, DataPoint.y)
else
begin
if not Assigned(FDetailColumns) then
FDetailColumns := TfcxCubeDataColumns.Create;
ShowDetails(Grid.Slice, Grid.PaintStyle, Point(DataPoint.X, DataPoint.Y), FDetailColumns, Grid);
end;
inherited;
end;
Example of OnDataDblClick event:
SliceGrid1DataDblClick(Sender: TfcxSliceDataZone; XAxisIndex, YAxisIndex : Integer)
var
DetailColumns: TfcxCubeDataColumns;
NeedHideItemIndex: integer;
begin
DetailColumns := TfcxCubeDataColumns.Create;
DetailColumns.Update(Sender.Grid.Slice.Cube);
NeedHideItemIndex := 0; //!!!! Set index of field to hide
DetailColumns.AbsItems[NeedHideItemIndex].Visible := False;
ShowDetails(Sender.Grid.Slice, Sender.Grid.PaintStyle, Point(XAxisIndex, YAxisIndex), DetailColumns, Sender.Grid);
end;