dbf_usr Posted October 29, 2019 Share Posted October 29, 2019 UniDBGrid - в Runtime не включается группировка. Если на момент запуска приложения группировка не была включена -то включить ее вовремя выполнения программы не получается - она не включается. Так же ее нельзя отключить если она была включена. procedure TUniPrices.UniComboBox1Change(Sender: TObject); begin if UniComboBox1.ItemIndex=0 then begin UniDBGrid1.Grouping.Enabled:=false; end; if UniComboBox1.ItemIndex=1 then begin UniDBGrid1.Grouping.FieldName:= 'type_price'; UniMainModule.PgPrices.IndexFieldNames := 'type_price'; UniDBGrid1.Refresh; //showmessage('Group by Day'); UniDBGrid1.Grouping.Enabled:=true; end; if UniComboBox1.ItemIndex=0 then begin UniDBGrid1.Grouping.FieldName:= 'Product_name'; UniMainModule.PgPrices.IndexFieldNames := 'Product_name'; UniDBGrid1.Refresh; //showmessage('Group by Day'); UniDBGrid1.Grouping.Enabled:=true; end; end; procedure TUniPrices.UniDBGrid1ColumnSort(Column: TUniDBGridColumn; Direction: Boolean); begin if UniComboBox1.ItemIndex=0 then begin UniDBGrid1.Grouping.FieldName:= ''; if SameText(Column.FieldName, '') then UniMainModule.PgPrices.IndexFieldNames := ''; end; if UniComboBox1.ItemIndex=1 then begin UniDBGrid1.Grouping.FieldName:= 'type_price'; if SameText(Column.FieldName, 'type_price') then UniMainModule.PgPrices.IndexFieldNames := 'type_price'; end; if UniComboBox1.ItemIndex=2 then begin UniDBGrid1.Grouping.FieldName:= 'Product_name'; if SameText(Column.FieldName, 'Product_name') then UniMainModule.PgPrices.IndexFieldNames := 'Product_name'; end; end; Что посоветуете? 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.