TcxGridTableViewStyles.NewItemRowInfoText Property
Specifies the style for the text displayed in the background of a new item row.
Declaration
property NewItemRowInfoText: TcxStyle index vsNewItemRowInfoText read; write;
Property Value
Type |
---|
TcxStyle |
Remarks
The NewItemRowInfoText property specifies the style (font attributes and text color) used to draw text in the background of a new item row. The text is specified by the View’s OptionsView.NewItemRowInfoText property. It is displayed if the new item row is not focused.
To specify the style for the info text:
Create a TcxStyle object using a TcxStyleRepository component, for instance.
Customize the new style depending on your needs. (Note that you are able to customize the style later at any time you need)
Assign it to the NewItemRowInfoText property
The following example shows how to create and customize a style for the info text of a new item row in a tvCustomers View. When creating the style, the form (Self) is specified as its owner. Thus, the style is automatically destroyed when destroying the form.
FInfoStyle: TcxStyle;
//...
procedure TForm1.FormCreate(Sender: TObject);
begin
FInfoStyle := TcxStyle.Create(Self);
with FInfoStyle do
begin
TextColor := clPurple;
Font.Name := 'Courier New';
end;
tvCustomers.Styles.NewItemRowInfoText := FInfoStyle;
end;
The image below shows the info text (‘Click here to add a new row’) drawn using the specified style: