Skepsis IT Posted May 6, 2019 Share Posted May 6, 2019 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 8, 2019 Share Posted May 8, 2019 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? Quote Link to comment Share on other sites More sharing options...
Skepsis IT Posted May 13, 2019 Author Share Posted May 13, 2019 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; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 13, 2019 Share Posted May 13, 2019 1 hour ago, Skepsis IT said: According to a specific field I set the appropriate editor to the column. At runtime, once? Quote Link to comment Share on other sites More sharing options...
Skepsis IT Posted May 13, 2019 Author Share Posted May 13, 2019 Yes only once at a time. More specifically when a record is loaded Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 13, 2019 Share Posted May 13, 2019 8 hours ago, Skepsis IT said: Yes only once at a time. More specifically when a record is loaded Can you make a simple testcase for reproduce? Quote Link to comment Share on other sites More sharing options...
Skepsis IT Posted June 18, 2019 Author Share Posted June 18, 2019 Hi, I have attached a simple testcase. Looking forward for your answer. Regards testcasegrideditor.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 18, 2019 Share Posted June 18, 2019 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; Quote Link to comment Share on other sites More sharing options...
Skepsis IT Posted June 18, 2019 Author Share Posted June 18, 2019 Works great! Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.