Jump to content
uniGUI Discussion Forums
Sign in to follow this  
jaromir

UniDBGrid row selection / grouped

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Thanks - but this is workaround - specially demand OnAfterLoad.

 

Programmatically row selection is base functionality - could You make any more elegant solution please ?

 

Thank You.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Hi,

 

Have you tried to use for example like this?!:

DataSource1.DataSet.Locate('CustNo', 2165, [])

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×