Groups | Blog | Home
all groups > dotnet windows forms databinding > november 2004 >

dotnet windows forms databinding : Datagrid does not reflect changes to bound dataset



Peter Kenyon
11/12/2004 12:18:28 PM
Hi,

I am using a datagrid to display a few columns from a dataset and a "detail"
form for editing, which appears after double-clicking a row in the grid.
After the user finishes editing an item with the detail form, the changes he
has made do not show up in the datagrid even though both are bound to the
same dataset. How can I refresh the contents of the current row in the
datagrid so that the changes show up?

TIA,

Peter

Sijin Joseph
11/20/2004 11:20:55 AM
You can use the CurrencyManager.Refresh() method to refresh the changes

Something line

this.BindingContext[dataset,"datamember"].Refresh();

where dataset is the refernce to your dataset and datamember is the name
fo the table you are binding to.

Hope that helps.


Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

[quoted text, click to view]
AddThis Social Bookmark Button