Hello.
1. You can't add icon to the top row, but you can do it more logical, place button with icon "Add" near with top row.
procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
Form1.TableGrid1.AllowCreate := False;
end;
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
Form1.TableGrid1.AllowCreate := not Form1.TableGrid1.AllowCreate;
if Form1.TableGrid1.AllowCreate then Form1.Button1.dbIconName := 'Cancel' else Form1.Button1.dbIconName := 'New';
end;
2. You can change text, but not color.
procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
Form1.TableGrid1.Columns[0].InputCaption := 'your text';
end;
3.
procedure Form1_TableGrid1_OnInputAccept (Sender: TObject; var Accept: Boolean);
begin
if (Form1.TableGrid1.Columns[1].InputValue <> '') and (Form1.TableGrid1.Columns[1].InputValue <> '0') then Form1.TableGrid1.Columns[0].InputValue := '0';
if (Form1.TableGrid1.Columns[0].InputValue <> '') and (Form1.TableGrid1.Columns[0].InputValue <> '0') then Form1.TableGrid1.Columns[1].InputValue := '0';
end;
4. It doesn't support.
5. Date formatting is determined by the user's regional settings, but you can change it:
procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
TNxDateColumn(Form1.TableGrid1.Columns[0).FormatMask :='dd.mm.yyyy';
end;
The following formatting character strings can be used in the Formatting string:
y = Year last 2 digits
yy = Year last 2 digits
yyyy = Year as 4 digits
m = Month number no-leading 0
mm = Month number as 2 digits
mmm = Month using ShortDayNames (Jan)
mmmm = Month using LongDayNames (January)
d = Day number no-leading 0
dd = Day number as 2 digits
ddd = Day using ShortDayNames (Sun)
dddd = Day using LongDayNames (Sunday)
ddddd = Day in ShortDateFormat
dddddd = Day in LongDateFormat
c = Use ShortDateFormat + LongTimeFormat
h = Hour number no-leading 0
hh = Hour number as 2 digits
n = Minute number no-leading 0
nn = Minute number as 2 digits
s = Second number no-leading 0
ss = Second number as 2 digits
z = Milli-sec number no-leading 0s
zzz = Milli-sec number as 3 digits
t = Use ShortTimeFormat
tt = Use LongTimeFormat
am/pm = Use after h : gives 12 hours + am/pm
a/p = Use after h : gives 12 hours + a/p
ampm = As a/p but TimeAMString,TimePMString
/ = Substituted by DateSeparator value
: = Substituted by TimeSeparator value
6. Just clear all components which used for searching, then call method dbUpdate
Example
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
Form1.edFirstName.Clear;
Form1.cbGroup.dbItemID := -1;
Form1.DateTimePicker1.Checked := False;
Form1.TableGrid1.dbUpdate;
end;
Dmitry.