Jump to content

dbgrid row change


jahlxx

Recommended Posts

Yes. Now I have in that way, but since I don't kow what update, when close a form that contains that event in some dataset. the application raises an error.

I use UniDAC, but opened a case with them, and they say that it's not a UniDAC bug, is some thing in the application that raises the dataset event.

I have tested the same with a VCL application, and works OK, but not with UniGUI. In UniGUI, closing a form, raises the afterscroll event of the dataset, and raises an error.

So I was thinking about change the afterscroll event for other similar event of other element, for example, the dbgrid.

 

Link to comment
Share on other sites

2 hours ago, jahlxx said:

Yes. Now I have in that way, but since I don't kow what update, when close a form that contains that event in some dataset. the application raises an error.

I use UniDAC, but opened a case with them, and they say that it's not a UniDAC bug, is some thing in the application that raises the dataset event.

I have tested the same with a VCL application, and works OK, but not with UniGUI. In UniGUI, closing a form, raises the afterscroll event of the dataset, and raises an error.

So I was thinking about change the afterscroll event for other similar event of other element, for example, the dbgrid.

 

Hi

Can you please create a test case?

Link to comment
Share on other sites

On 5/1/2021 at 2:00 PM, Sherzod said:

Hello,

UniDBGrid -> OnSelectionChange event for example.

Thanks, but it seems to be slower than afterscroll, andd raises the event even changing column. I need only when changing row.

 

Link to comment
Share on other sites

On 5/1/2021 at 11:52 AM, jahlxx said:

. In UniGUI, closing a form, raises the afterscroll event of the dataset, and raises an error.

Hello, when Form is closed, all components are destroyed if FreeOnClose is Enabled.

How is in Your application ?

Link to comment
Share on other sites

4 minutes ago, jahlxx said:

Same error

So, try to this:

Create uniMainModule variable like: FormIsClosed : Boolean;

When Close Form then set it True.

Add In AfterScroll:

If not FormIsClosed then begin

//You logic here

end;

This is not a solution to the global problem, but it can help you work around the error message

Link to comment
Share on other sites

8 minutes ago, jahlxx said:

Yes, it works, thanks.

But is strange this behaviour. In older versions worked fine.

Thanks.

If this work, maybe You problem is here:

1. Where are the components of your query / table, who is the owner?

2. It is created dinamically or it's created in form creation ?

 

Link to comment
Share on other sites

1 minute ago, jahlxx said:

Hi.

The components are created in design time, they are in the form, and the owner is the same form.

 

How do You create component, any example ?

I use this, but create it in Mainmodule:

          //add AdoQueryServerUses

          // search adoquery if Exist
          UniMainModule.FormAdoQuery := TAdoQuery (FindComponentEx ('AdoQueryServerUses_' + MainForm.Name));
          If UniMainModule.FormAdoQuery =  nil then begin
              UniMainModule.FormAdoQuery := TAdoQuery.Create (uniMainModule);//TuniForm (MainForm));
              UniMainModule.FormAdoQuery.Name := 'AdoQueryServerUses_' + MainForm.Name;
          end;

Link to comment
Share on other sites

for x:=0 to self.components.count-1 do
  begin
   if self.components[x] is tuniquery then
      begin
        tuniquery(self.components[x]).afterscroll :=nil;
        tuniquery(self.components[x]).close;
      end;
  end

 

this will disable afterscroll from all your queries, and close them.

Link to comment
Share on other sites

8 hours ago, wilton_rad said:

tuniquery(self.components[x]).afterscroll

Ok.

This almost works.

I tried something like this some weeks ago, and the problem is the same. Works when you close the form, but dont work when you close the application.

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...