dalpiaze Posted May 8, 2012 Share 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 ? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 8, 2012 Administrators Share Posted May 8, 2012 Test case is needed. Thx Link to comment Share on other sites More sharing options...
albertovesx Posted May 8, 2012 Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now