Jump to content

Fixed width for column in UniDBGrid


artem_niko

Recommended Posts

Good afternoon!
There are several columns in my table. I need to pin the width of some columns so that it is fixed on the specified columns. Unfortunately, the columns do not have a property Columns.MaxWidth (I hope that appears in the following assemblies).
For example, there are 5 columns in my table. I need the width of 1,2,4 columns to be fixed and not to change with the property ForceFit:=True
How can I do that?

Link to comment
Share on other sites

2 hours ago, Артем said:

Columns.MaxWidth

Hello,

You can try this approach I think:

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  with UniDBGrid1 do
  begin
    // Columns[1] for example
    JSInterface.JSConfig('minWidth', [150], Columns[1].JSColumn);
    JSInterface.JSConfig('maxWidth', [150], Columns[1].JSColumn);
  end;
end;

 

  • Like 1
Link to comment
Share on other sites

14 minutes ago, Sherzod said:

Hello,

You can try this approach I think:


procedure TMainForm.UniFormReady(Sender: TObject);
begin
  with UniDBGrid1 do
  begin
    // Columns[1] for example
    JSInterface.JSConfig('minWidth', [150], Columns[1].JSColumn);
    JSInterface.JSConfig('maxWidth', [150], Columns[1].JSColumn);
  end;
end;

 

Thank's, working! :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...