jaromir Posted April 3, 2017 Share Posted April 3, 2017 Hi, How can I select row at delphi code when the grid is grouped by some field ? Without grouping I can achive this by underlying dataset. But with grouping it doesn't work. For example - I have grid with 10 records - something like: grid.select(8) for select row at index 8. Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 3, 2017 Share Posted April 3, 2017 Hi, Maybe you wanted like this ?: http://forums.unigui.com/index.php?/topic/6309-multiselect-unidbgrid-select-rows-programmatically/ Best regards. Quote Link to comment Share on other sites More sharing options...
jaromir Posted April 3, 2017 Author Share Posted April 3, 2017 Thanks - but this is workaround - specially demand OnAfterLoad. Programmatically row selection is base functionality - could You make any more elegant solution please ? Thank You. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 3, 2017 Share Posted April 3, 2017 Ok, I will analyze this Quote Link to comment Share on other sites More sharing options...
jaromir Posted April 12, 2017 Author Share Posted April 12, 2017 Hi, Is it possible to have any solution for this please ? I can't select rows from code where grid is grouped. Only solution is mentioned above which is just workaround in my opinion. Thank You. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 12, 2017 Share Posted April 12, 2017 Hi, Have you tried to use for example like this?!: DataSource1.DataSet.Locate('CustNo', 2165, []) Quote Link to comment Share on other sites More sharing options...
jaromir Posted April 12, 2017 Author Share Posted April 12, 2017 Thanks Delphi Developer. Here is the same problem like before. Tested in GridGrouping demo.When You have button with event: procedure TMainForm.UniButton2Click(Sender: TObject); begin DataSource1.DataSet.Locate('Company', 'Tora Tora Tora', [loCaseInsensitive]); end; It works ok. But if You have: procedure TMainForm.UniButton2Click(Sender: TObject); begin DataSource1.DataSet.Close; DataSource1.DataSet.Open; DataSource1.DataSet.Locate('Company', 'Tora Tora Tora', [loCaseInsensitive]); end; It doesn't work. So like before we have to make something like OnAfterLoad assigment - which is wrong solution. Could You help please ? Quote Link to comment Share on other sites More sharing options...
zilav Posted April 13, 2017 Share Posted April 13, 2017 Start UniTimer after opening dataset with 10ms delay which will do Locate. But yes, it is an ungly workaround. Would like UniGui to work properly with Locate in grouped grids too. Quote Link to comment Share on other sites More sharing options...
jaromir Posted April 13, 2017 Author Share Posted April 13, 2017 Zilav - don't You think that this solution doesn't fit for RC release ? With all my 4 months UniGui love there is a lot of this kind of problems. Non working font control properties, non working locale settings, action updates, treeview expand methods, etc, etc. From first view framework works ok, but in details there is a lot of undone work. 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.