Child grids won't show new or edited values unless grid clicked

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Child grids won't show new or edited values unless grid clicked

The child grids are read only. Below them are edit, add and delete buttons.
The edit and add buttons open up separate forms in which one field (keyword
or searchphrase, respectively) can be edited. The two forms are connected by
a currency manager.

When I click the OK button on the form after editing the page, the grid is
unchanged. If I click the grid, the changed or added field that can be
edited appear correctly.

I've taken this from chapter 13 of ado.net core reference and for the life
of me I can't see what I'm lacking or error I'm making. There is a boolean
field but it is set to active in the calling form.

Can anybody help me or at least tell me what additional information they
need. If it is the boolean field that's causing the problem, why is the same
problem occuring with edit and well as add?

dennis
 
I just want to add that this is the code that is called by the calling form:

Public Sub EditSearchPhrase(ByVal cm As CurrencyManager)
drvSearchPhrase = CType(cm.Current, DataRowView)
vueSearchPhrase = drvSearchPhrase.DataView
Me.BindingContext(vueSearchPhrase).Position = cm.Position
txtSearchPhrase.DataBindings.Add("Text", vueSearchPhrase,
"SearchPhrase")
txtKeywordSetID.DataBindings.Add("Text", vueSearchPhrase,
"KeywordSetID")
chkActive.DataBindings.Add("Checked", vueSearchPhrase, "Active")
 
Hi Dennis,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that the DataGrid which shows keyword and
SearchPhrase don't get refreshed when data in the DataSet is modified. If
there is any misunderstanding, please feel free to let me know.

In this case, we can simply add a DataGrid.Refresh() call to achieve this.
It will get the latest data from the data source. here I added it right
after the popup edit window returns. HTH.

If cm.Count > 0 Then
If cmK.Count > 0 Then
Dim frmEditKeyword As New frmEditKeyword
With frmEditKeyword
.EditKeyword(cmK)
.KeywordSetID = Me.KSID
.ShowDialog()
End With
frmEditKeyword.Dispose()
Me.dgrdKeyword.Refresh() 'Refresh the DataGrid to show
latest data.
Else
........

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
You're welcome, Dennis.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top