473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Datagrid Refresh problem

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
2 4536
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
1
by: Shawn Benson | last post by:
I have a Windows form where a user enters an order number which returns a dataset that is bound to a datagrid. The problem is when a user clicks on a cell in the datagrid, then enters another...
3
by: Matthew Woods | last post by:
Hi, is there any way to format and order the columns displayed in a datagrid bound to a class that inherits from IBindingList? i have used DataGridTableStyle and added DataGridTextBoxColumns to it...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
8
by: Inigo Jimenez | last post by:
I have an ASP .net web application installed in a Windows 2003 server. This web application has a webform that has a Datagrid. This Datagrid is filled with the data of a SQL table. I have a...
3
by: james crosthwaite via .NET 247 | last post by:
Hi, I'm pretty new to .NET and i'm having a major problem which ireally need some help with. I am developing an application for my office which allows usersto book rooms. I have a Booking Form...
1
by: Andre | last post by:
hi, In my Datagrid i have some text and a image (for each item), if i edit the image and save it to the HD there's no problem, but the image is always saved with the same name (item number.jpg)...
7
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output...
1
by: Kevin Hodgson | last post by:
I'm having a strange problem with a VB.NET App, and the built in Windows.Forms.Datagrid I have a tabbed interface, and a DataGrid (along with other controls) on each of my two Tabs. If the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.