dalpiaze Posted May 8, 2012 Posted May 8, 2012 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 ? Quote
Administrators Farshad Mohajeri Posted May 8, 2012 Administrators Posted May 8, 2012 Test case is needed. Thx Quote
AlbertoVesx Posted May 8, 2012 Posted May 8, 2012 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. Quote
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.