How can i change width of Fix-Column DBGrid?? lazarus / 16-Databases ---------------------------------------------------------------------- majid.ebru · 2017-08-09 13:06 Hi . How can i change width of Fix-Column DBGrid( Red area in image attached)?? . Thankyou ---------------------------------------------------------------------- howardpc · 2017-08-09 16:31 It is not possible with TDBGrid, since its options lack a flag equivalent to TStringGrid's goFixedColSizing. Perhaps by creating a descendant control you could make access to sizing the fixed column possible, but its design indicates that this possiblity has been excluded deliberately. ---------------------------------------------------------------------- balazsszekely · 2017-08-09 17:37 @majid.ebru You should subclass TDBGrid or write a class helper, but if you're lazy just copy DBGrid.pas from $(LazarusDir)\lcl folder to your project directory and change the line(see screenshot). ---------------------------------------------------------------------- majid.ebru · 2017-08-10 18:12 Oh my God thank you very much  but i think i can not do that, that is Dangerous ---------------------------------------------------------------------- wp · 2017-08-10 18:31 Open a bugtracker ticket with a feature request. I don't see a reason why this number should be hard-coded. I It could a public property of TDBGrid, or at least a var in the interface section of dbgrids as well. Even scaling of the grid with screen resolution does not work here. ---------------------------------------------------------------------- Handoko · 2017-08-10 18:35 @majid.ebru You can use the similar trick here to access the ColWidths: http://forum.lazarus.freepascal.org/index.php/topic,37851.msg255814.ht ml#msg255814 ---------------------------------------------------------------------- wp · 2017-08-10 19:45 I did try this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TMyDBGrid = class(TDBGrid); procedure TForm1.Button1Click(Sender: TObject);begin  TMyDBGrid(DBGrid1).ColWidths[0] := 50;end; But against all expectations it does not work. Looking at the source code I find the following method which seems to be called whenever a column width changes. This is where the width of the indicator cell is set to 12 pixesl. So, if my hacked button-click code above, tries to set the indicator width to 50, the change of this column triggers UpdateGridColmnSizes which resets it back to 12... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TCustomDBGrid.UpdateGridColumnSizes;var  i: Integer;begin  {$ifdef dbgDBGrid}  DebugLn('%s.UpdateGridColumnSizes', [ClassName]);  {$endif}  if FDefaultColWidths then begin    if dgIndicator in Options then      ColWidths[0]:=12;    if NeedAutoSizeColumns then      UpdateAutoSizeColumns;  end;end; ---------------------------------------------------------------------- majid.ebru · 2017-08-11 09:06 Quote from: GetMem on August 09, 2017, 07:37:43 pm@majid.ebru You should subclass TDBGrid or write a class helper, but if you're lazy just copy DBGrid.pas from $(LazarusDir)\lcl folder to your project directory and change the line(see screenshot). Hi . this code work. thankyou