Jump to content

TUniDBGrid - DataSet position in WebMode


dalpiaze

Recommended Posts

I'm using a TUniDBGrid linked to a TDataSource, and the TDataSource linked to a TTable.

 

When I do:

Table1.Append;

Table1.FieldByName('campo').AsString := value;

Table1.Post;

 

The record in DataSet automatically moves to the new record (ok!)

 

But in TUniDBGrid the selection is currently in the previous record.

When DataSet fires update to the linked components (including DBGrid), the record change to the new position,

But TUniDBGrid fires some Refresh event after that and set the previous position to the DataSet according with the original selection, losing the new record position.

 

This occurs only in WebMode.

 

----

I try to do that:

 

UniDBGrid1.DataSource := nil;

Table1.Append;

Table1.FieldByName('campo').AsString := value;

Table1.Post;

UniDBGrid1.DataSource := DataSource1;

 

And then works perfect (when the Grid refreshs, the new record comes selected).

-----

Is this a bug or how to workaround ?

Link to comment
Share on other sites

I'm using a TUniDBGrid linked to a TDataSource, and the TDataSource linked to a TTable.

 

When I do:

Table1.Append;

Table1.FieldByName('campo').AsString := value;

Table1.Post;

 

The record in DataSet automatically moves to the new record (ok!)

 

But in TUniDBGrid the selection is currently in the previous record.

When DataSet fires update to the linked components (including DBGrid), the record change to the new position,

But TUniDBGrid fires some Refresh event after that and set the previous position to the DataSet according with the original selection, losing the new record position.

 

This occurs only in WebMode.

 

----

I try to do that:

 

UniDBGrid1.DataSource := nil;

Table1.Append;

Table1.FieldByName('campo').AsString := value;

Table1.Post;

UniDBGrid1.DataSource := DataSource1;

 

And then works perfect (when the Grid refreshs, the new record comes selected).

-----

Is this a bug or how to workaround ?

 

Same error happends to me. And I solve it in the same way. I think it is a bug.

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...