eduardosuruagy Posted August 24, 2020 Posted August 24, 2020 Example error C: \ Program Files (x86) \ FMSoft \ Framework \ uniGUI \ Demos \ Desktop \ GridGrouping - Dynamic When I leave the option UniDBGrid1.Grouping.Enabled: = False and I run the system then I try to enable grouping via code and it doesn't work, it simply does nothing. This error I had posted before. Quote
Sherzod Posted August 25, 2020 Posted August 25, 2020 11 hours ago, eduardosuruagy said: When I leave the option UniDBGrid1.Grouping.Enabled: = False and I run the system then I try to enable grouping via code and it doesn't work, it simply does nothing. This error I had posted before. Hello, Is this solution ok for you? 1. In DesignTime: UniDBGrid1.Grouping.Enabled = True 2. procedure TMainForm.UniFormReady(Sender: TObject); begin UniDBGrid1.Grouping.Enabled := False; end; 3. Then you can use: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniDBGrid1.Grouping.Enabled := not UniDBGrid1.Grouping.Enabled; end; 1 Quote
eduardosuruagy Posted August 25, 2020 Author Posted August 25, 2020 58 minutes ago, Sherzod said: Hello, Is this solution ok for you? 1. In DesignTime: UniDBGrid1.Grouping.Enabled = True 2. procedure TMainForm.UniFormReady(Sender: TObject); begin UniDBGrid1.Grouping.Enabled := False; end; 3. Then you can use: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniDBGrid1.Grouping.Enabled := not UniDBGrid1.Grouping.Enabled; end; Yes it worked, explain the difference between onActivate, onShow and onReady? Because at the beginning I did the test on onShow and it didn't work. Quote
Abaksoft Posted August 26, 2020 Posted August 26, 2020 21 hours ago, eduardosuruagy said: ......, explain the difference between onActivate, onShow and onReady? @Sherzod, I have never understand this me too. Thx +1 Quote
Abaksoft Posted August 26, 2020 Posted August 26, 2020 Sorry for the classical questions. A simple google search gives : 1. onActivate vs OnShow : https://forum.lazarus.freepascal.org/index.php?topic=15103.0 2. OnReady http://www.unigui.com/doc/online_help/api/uniGUIForm_TUniForm_OnReady.html Quote
picyka Posted September 8, 2021 Posted September 8, 2021 On 8/25/2020 at 8:40 AM, Sherzod said: Hello, Is this solution ok for you? 1. In DesignTime: UniDBGrid1.Grouping.Enabled = True 2. procedure TMainForm.UniFormReady(Sender: TObject); begin UniDBGrid1.Grouping.Enabled := False; end; 3. Then you can use: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniDBGrid1.Grouping.Enabled := not UniDBGrid1.Grouping.Enabled; end; This desktop approach works, but when using TUnimDBGrid or error. procedure TUniFrameCadAtendVeiculoM.UnimDBGridServicosSwipe(Sender: TObject); begin Self.UnimDBGridServicos.Grouping.Enabled := not Self.UnimDBGridServicos.Grouping.Enabled; end; Quote
Sherzod Posted September 8, 2021 Posted September 8, 2021 2 hours ago, picyka said: Hello, Try this approach: procedure TMainmForm.UnimButton1Click(Sender: TObject); begin with UnimDBGrid1 do JSInterface.JSCode(#1'.setGrouped(!'#1'.getGrouped());') end; Quote
picyka Posted September 8, 2021 Posted September 8, 2021 10 minutes ago, Sherzod said: Hello, Try this approach: procedure TMainmForm.UnimButton1Click(Sender: TObject); begin with UnimDBGrid1 do JSInterface.JSCode(#1'.setGrouped(!'#1'.getGrouped());') end; 1) by default Grouping comes true. 2) procedure TUniFrameCadAtendVeiculoM.UnimFormCreate(Sender: TObject); begin inherited; Self.UnimDBGridServicos.Grouping.Enabled := False; end; 3) procedure TUniFrameCadAtendVeiculoM.UnimDBGridServicosClickHold( Sender: TObject); begin UnimDBGridServicos.JSInterface.JSCode(#1'.setGrouped(!'#1'.getGrouped());'); inherited; end; Item 3 doesn't work, doesn't enable grouping. Quote
Sherzod Posted September 8, 2021 Posted September 8, 2021 2 minutes ago, picyka said: UnimFormCreate Use UnimFormReady event. 1 Quote
picyka Posted September 8, 2021 Posted September 8, 2021 5 minutes ago, Sherzod said: Use UnimFormReady event. good oh, it worked 1 Quote
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.