By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,209 Members | 1,706 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,209 IT Pros & Developers. It's quick & easy.

Datagrid Refresh problem

P: n/a
Dan
Hi,

I have a Datagrid in a simple form that I programmatically modify
using something like that :

Me.DataGrid1(RowID, ColID) = "blablabla"

But my cell wont refresh unless I click on another cell or move the
scrollbar of the datagrid... :(

I tried everything : .Update, .Refresh, .Invalidate, etc...

How can I refresh it?

Thanks

Daniel
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Dan,

Programmatically, I would change the data in the datasource that binds to
the control, and do a "Refresh()". From a UI point of view, this is
equivalent to going to a cell, changing the data and clicking outside of the
cell. The cell is not considered changed until you move out of it.

Simply:

DG1.DataSource = dataSet1.Tables["foobar"]

....

' Change the data in the dataset
....

' Refresh the data in the datagrid
dataSet1.Refresh

Hope that helps.
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Dan" <da*************@gmail.com> wrote in message
news:64**************************@posting.google.c om...
Hi,

I have a Datagrid in a simple form that I programmatically modify
using something like that :

Me.DataGrid1(RowID, ColID) = "blablabla"

But my cell wont refresh unless I click on another cell or move the
scrollbar of the datagrid... :(

I tried everything : .Update, .Refresh, .Invalidate, etc...

How can I refresh it?

Thanks

Daniel

Nov 21 '05 #2

P: n/a
Dan,
Solution 1: Get BindingManagerBase from dataGrid.BindingContext Property,
call BindingManagerBase.EndCurrentEdit Method.

Solution 2:
"Dan" wrote: DO NOT use Me.DataGrid1(RowID, ColID) = "blablabla". Set the
value directly to DataTable or DataView which you are bound to DataGrid.

Good Luck.

Rulin Hong
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.