473,396 Members | 1,755 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,396 software developers and data experts.

Refresh datagrid without setting datasource to nothing and initialize again

AA
Do anyone know how to refresh the datagrid without setting datasource to
nothing and initialize the grid again?

My case is that I have form consisting from two part. The upper part is a
datagrid while the lower is the record detail.
Once user, said selected/hightlighted row 3 for editing the detail info.
Then, user click "Save". I want the datagrid to be refreshed so as to
displaying the latest changes of the record info without moving out the
focus from row 3.

Thx in advance!

Richard
Nov 20 '05 #1
2 2647
AA

O assume that we are talking about a windowforms.

A datagrid holds no data, it displays the data via the datasource (which
mostly holds as well not data). So changing items to what the datasource
references again to should change the datagrid as well.
Do anyone know how to refresh the datagrid without setting datasource to
nothing and initialize the grid again?
What can be is that your data is still only in the textbox and than you have
to do something as

bindingcontext(directcast(datagrid1.datasource,dat aset)).endcurentedit

(where dataset is datatable or dataview when it are one of those)

(I tried this one never in this way however that should go in my opinion)

When not message back.

I hope this helps?

Cor
Cor

My case is that I have form consisting from two part. The upper part is a
datagrid while the lower is the record detail.
Once user, said selected/hightlighted row 3 for editing the detail info.
Then, user click "Save". I want the datagrid to be refreshed so as to
displaying the latest changes of the record info without moving out the
focus from row 3.

Thx in advance!

Richard

Nov 20 '05 #2
AA
Thx Cor....
Since I am using direct sql statement for updating the content,
may I need to refresh the datasource instead.

Let me try.....Thx a lot!

Richard
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eM**************@TK2MSFTNGP11.phx.gbl...
AA

O assume that we are talking about a windowforms.

A datagrid holds no data, it displays the data via the datasource (which
mostly holds as well not data). So changing items to what the datasource
references again to should change the datagrid as well.
Do anyone know how to refresh the datagrid without setting datasource to
nothing and initialize the grid again?
What can be is that your data is still only in the textbox and than you

have to do something as

bindingcontext(directcast(datagrid1.datasource,dat aset)).endcurentedit

(where dataset is datatable or dataview when it are one of those)

(I tried this one never in this way however that should go in my opinion)

When not message back.

I hope this helps?

Cor
Cor

My case is that I have form consisting from two part. The upper part is a datagrid while the lower is the record detail.
Once user, said selected/hightlighted row 3 for editing the detail info.
Then, user click "Save". I want the datagrid to be refreshed so as to
displaying the latest changes of the record info without moving out the
focus from row 3.

Thx in advance!

Richard


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
2
by: Aaron Ackerman | last post by:
I cannot a row to this bound DataGrid to SAVE MY LIFE! I have tried everything and I am at a loss. The using goes into add mode with the add button adds his data then updates with the update...
12
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the...
1
by: Jim Bayers | last post by:
I have a datagrid on a form that's bound to a datareader. When I click on my browser's refresh button, it adds a duplicate record to the bottom of the datagrid. This record appears in the...
5
by: Jim Bayers | last post by:
I have a simple page, all that's on it is a datagrid. The datagrid is populated on page_load when it is bound to a datareader. The problem is: when a user refreshes the page, new records are...
0
by: John Hopper | last post by:
Can someone please tell me why the datagrid doesn't databind and display rows once the Add button is clicked and the cmdSaveToDataset event fires, to add a row to the dataset? I've copied the code:...
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...
4
by: Jan Nielsen | last post by:
Hi all I'm a former Access developer who would like to implement a many-to-many relation in about the same way you do in Access: With a subform and a combo box. Is it possible to use a...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.