How to change the bmp in code for the row indicator ?
DBAdvGrid_Certificate.RowIndicator.????? := add.bmp if add mode
edit.bmp if edit mode and etc.
How to change the bmp in code for the row indicator ?
DBAdvGrid_Certificate.RowIndicator.????? := add.bmp if add mode
edit.bmp if edit mode and etc.
Did you try something like:
dbadvgrid.RowIndicator.LoadFrom* ?
yes but not success.
procedure Tfrm_Certificate_Information.update_staff_info_details_cert_grid_indicator( v_mode: String );
//var bmp : TBitmap;
begin {
bmp := TBitmap.Create;
//Bmp.LoadFromResourceName(HInstance,'Bitmap_Cell_BrowseMode');
if v_mode = 'ADD' then
DBAdvGrid_Certificate.RowIndicator.
bmp.Free; }
With DataModule_CLM_CertInfo do
begin
if sql_Staff_Info_Details_Cert.Active then
if (sql_Staff_Info_Details_Cert.FieldByName('created_on').Value <> null) then
ShowMessage( FormatDateTime('YYYY-DD-MM', sql_Staff_Info_Details_Cert.FieldByName('created_on').Value ) );
end; //end With
end;
How does your code related to what I suggested?
It shown error and I am not sure the syntax as I am first time use the resources fle
procedure Tfrm_Certificate_Information.update_staff_info_details_cert_grid_indicator( v_mode: String );
var bmp : TBitmap;
begin
bmp := TBitmap.Create;
DBAdvGrid_Certificate.RowIndicator.LoadFromResourceName(HInstance,'Bitmap_Cell_BrowseMode');
bmp.Free;
end;
I tested this here with:
procedure TForm1.FormCreate(Sender: TObject);
begin
grid.RowIndicator.LoadFromFile('W:\Graphics\Glyphs\cancel16.bmp');
end;
and this works as expected.
Given you get an AV, check if DBAdvGrid_Certificate really exists when you call this method.
still error. how to check grid exist ?
if Assigned(grid) ...
Please isolate this and send a sample source project with which we can reproduce this.
When I drop a new TDBAdvGrid on the form and add such code, this works without any issue, so you must be doing special things.