eduardosuruagy Posted August 24, 2020 Share 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. Link to comment Share on other sites More sharing options...
Sherzod Posted August 25, 2020 Share 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 Link to comment Share on other sites More sharing options...
eduardosuruagy Posted August 25, 2020 Author Share 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. Link to comment Share on other sites More sharing options...
Abaksoft Posted August 26, 2020 Share 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 Link to comment Share on other sites More sharing options...
Abaksoft Posted August 26, 2020 Share 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 Link to comment Share on other sites More sharing options...
picyka Posted September 8, 2021 Share 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; Link to comment Share on other sites More sharing options...
Sherzod Posted September 8, 2021 Share 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; Link to comment Share on other sites More sharing options...
picyka Posted September 8, 2021 Share 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. Link to comment Share on other sites More sharing options...
Sherzod Posted September 8, 2021 Share Posted September 8, 2021 2 minutes ago, picyka said: UnimFormCreate Use UnimFormReady event. 1 Link to comment Share on other sites More sharing options...
picyka Posted September 8, 2021 Share Posted September 8, 2021 5 minutes ago, Sherzod said: Use UnimFormReady event. good oh, it worked 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now