1

I am frustrated and desperate. I cannot understand why the detail view is not updated with the data of the newly inserted row.

I have a master and a detail grid view. The master dataset is a TADOQuery and the detail dataset is a TADOTable both connected to SQL Server. The datasources are connected okay and the master / detail keys are set okay.

I can edit / delete / insert in both views.

I am using NewItemRow in both views. When I insert new row in master view, a new row in added to the view as soon as I leave the NewItemRow. BUT this is not happening in the detail view, though. The data is actually inserted, the dataset events are fired but there is no new row added in the view itself. The only way to refresh the view is to deactive and re-activate the datasource but this is not a real solution, I think.

Why is this happening? What can I do to fix it?

Thank you very much in advance

Warren P
  • 65,725
  • 40
  • 181
  • 316
dpant
  • 1,622
  • 19
  • 30
  • 1
    if the data is actually inserted (to the db?) what do you mean by `there is no new row added in the view itself`? – kobik Jan 06 '12 at 13:29
  • The inserted data are not displayed in the view after the NewItemRow loses focus and becomes empty. But they have been posted to the underlying dataset. The user cannot see them, though. – dpant Jan 06 '12 at 13:33
  • only now I realized it's a devexpress grid issue (I didn't see the tags). do you use BeginEdit, EndEdit before and after you insert the new row? – kobik Jan 06 '12 at 14:01
  • No. The NewItemRow uses them automatically, no? If not, which event is appropriate to call EndEdit? – dpant Jan 06 '12 at 14:05
  • Have you tried using Insert or Append methods on the DataSet? You should add data to the underlying DataSet and let the controls update themselves. – Marcus Adams Jan 06 '12 at 14:23
  • @dpant, It could be a [bug...](http://www.devexpress.com/Support/Center/p/B143936.aspx). – kobik Jan 06 '12 at 14:30
  • Problem solved. It worked as soon as I checked the SmartRefresh option. Thank you very much for your contribution, kobik. – dpant Jan 06 '12 at 20:19
  • Grid.View.DataController.DataChanged – Mihaela Mar 05 '12 at 18:48

1 Answers1

0

Most of the times bugs like this are eliminated when turning on the Sync property in the grid's DataController.

However, I would suggest that you use the latest version of devex. They have really done a lot of work getting rid of annoyable bugs like that.

Bill Demos
  • 21
  • 1
  • 2