473,778 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2674
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(data grid1.datasourc e,dataset)).end curentedit

(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**********@p lanet.nl> wrote in message
news:eM******** ******@TK2MSFTN GP11.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(data grid1.datasourc e,dataset)).end curentedit

(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
9927
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 (multi-select without modifier keys). I got that working fine, but I also wanted to keep rows selected after a sort, which I do by storing the row's id in an arraylist. The idea was to do the sort and then go back and re-select the rows with that...
2
2711
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 button, seems simple. I am using ALL visual controls (supposedly to simplify things. If I was not using the visual controls and calling an ExecuteNonQuery no prob. Please look at my code and tell me what I am doing wrong. Also, what are the advatages...
12
2880
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 text into a stream in order to be able to use DataSetOutcomes1.ReadXML(MyStream). Thanks in advance, James
1
1204
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 underlying sql table. Why would it do this? How do you stop it. I just want the datagrid to display existing records, not modify the database. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load...
5
1635
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 added to the datagrid, duplicating everything that was there. How do I prevent this? Should I clear the datagrid at the top of every page_load? Can I set a variable the first time the page is loaded and check it for the next refresh?
0
1107
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: ------------------- Public Class WebForm1 Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code "
7
15443
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 the file to a folder, and then I read it back into the dataset using the dataset1.readxml. Up to this point, everything works wonderfully. The query executes, the dataset gets populated, and I get the results displayed in the datagrid.
4
2285
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 combobox in a datagrid? Any other suggestions/articles on how to implement many-many relations in the frontend (which of course are 2 one-many relations)?
8
3088
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 reflect the values they anticipate committing to see hypothetical totals of columns from a set of records. These records are displaying properly on my DataGrid but I'm not sure how to get Crystal Reports 10 to use as its datasource the dataset...
0
9629
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9470
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10127
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8957
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4033
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.