Jump to content

Unidbgrid column set editor dynamically


Skepsis IT

Recommended Posts

Hi,

when I set editor dynamically using also columns that created dynamically works ok. However when columns created at design time, set editor dynamically to specific columns not working.

eg. uniDBGrid1.Columns.Items[2].Editor:=edtInteger

Does anybody deal with that issue?

Thanks

Link to comment
Share on other sites

On 5/6/2019 at 7:47 PM, Skepsis IT said:

when I set editor dynamically using also columns that created dynamically works ok. However when columns created at design time, set editor dynamically to specific columns not working.

Hi,

Which build are you using and can you make a simple testcase for this?

Link to comment
Share on other sites

Hi,

using build1496. Testcase is a little bit difficult, but the scenario is simple.

I've got a unidbgrid with a unihiddenpanel that has 1 uniedit, 1 uniformatednumberedit and 1 unispinedit. Unidbgrid has 3 columns created at design time. According to a specific field I set the appropriate editor to the column.

e.g.

    if mu.DSCR='INTEGER' then
      uniDBGrid1.Columns.Items[1].Editor:=edtInteger
    else if mu.DSCR='DECIMAL' then
    begin
      edtDecimal.DecimalPrecision:=mu.DECPOINT;
      edtDecimal.FormattedInput.DecimalGroup:=mu.DECPOINT;
      UniDBGrid1.Columns.Items[1].Editor:=edtDecimal;
    end
    else
      UniDBGrid1.Columns.Items[1].Editor:=edtTime;

 

 

 

Link to comment
Share on other sites

  • 1 month later...
3 hours ago, Skepsis IT said:

I have attached a simple testcase.

Looking forward for your answer.

Hello,

You can try this approach ...

type
  TExUniCustomDBGrid = class (TUniCustomDBGrid)

  end;
procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  if mu.Text='NUMBER' then
    UniDBGrid1.Columns.Items[1].Editor:=edtDecimal
  else
    UniDBGrid1.Columns.Items[1].Editor:=edtTime;

  TExUniCustomDBGrid(UniDBGrid1).DoConfigureJSColumns(UniDBGrid1.DataSource.DataSet);
end;

 

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...