473,396 Members | 1,915 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.

Datagrid update

Hello,
I have a winform1 that contains the Datagrid and in winform2 you can add new
values to the database for datagrid.
I cannot update the datagrid on winform2 close event! All I want is to
update the contents of that datagrid when I close winform2.

Any help would be great.
Thanks

Jun 27 '08 #1
3 1143
You should update the DataGrid in winform1 instead of in winform2.
When you open winform2, you have a reference to it as variable.
So why not create a method or property in winform2 that returns the
new data? And receive it in winform1 to update the DataGrid.

Hope this helps.

On Apr 26, 7:23*pm, "Sonu" <replymeo...@hotmail.comwrote:
Hello,
I have a winform1 that contains the Datagrid and in winform2 you can add new
values to the database for datagrid.
I cannot update the datagrid on winform2 close event! All I want is to
update the contents of that datagrid when I close winform2.

Any help would be great.
Thanks
Jun 27 '08 #2
Sonu,

Are you sure that you have a DataGrid as that is seldom used by people who
have still questions like yours.

The DataGrid can be for a WindowsForm or Webform, however now people use
more the GridView and the DataGridView.

I don't think that it is possible to give you answers are not telling the
problems in a right way.

As you use a DataGrid, then tell which and in this case what version of VB
you are using.

Cor
"Sonu" <re*********@hotmail.comschreef in bericht
news:2C**********************************@microsof t.com...
Hello,
I have a winform1 that contains the Datagrid and in winform2 you can add
new values to the database for datagrid.
I cannot update the datagrid on winform2 close event! All I want is to
update the contents of that datagrid when I close winform2.

Any help would be great.
Thanks
Jun 27 '08 #3
There are many ways to solve your problem , however i will tell you my
vision where it doesn`t mather if you use a datagrid , datagridview or anny
other databound gui control
first of all use databinding with a dataset to your control
I guess you start form 2 from form 1 so just pass the dataset to form 2 ,
add delete or update the values in the dataset and when the form closes you
just perfom a rebind on the datasource
this will show the new data in the databound control on form 1

hth

Michel


"Sonu" <re*********@hotmail.comschreef in bericht
news:2C**********************************@microsof t.com...
Hello,
I have a winform1 that contains the Datagrid and in winform2 you can add
new values to the database for datagrid.
I cannot update the datagrid on winform2 close event! All I want is to
update the contents of that datagrid when I close winform2.

Any help would be great.
Thanks

Jun 27 '08 #4

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

Similar topics

4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
2
by: Manish | last post by:
Hey folks I am having a weird problem in ASP .Net. My page is in C#. I have a datagrid, which populates based on selection in drop down box on ASP page. This datagrid has template textbox colum in...
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...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
3
by: D. Shane Fowlkes | last post by:
I have a Datagrid which in theory, should allow you to edit and update the records. I've stripped my test page down so that it's only attempting to update one field - "description". Yet when I...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
4
by: David Colliver | last post by:
Hi all, I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are...
5
by: Tina | last post by:
the Edit, Update, Cancel, and Delete buttons in my datagrid are causing validation elsewhere on the page. I want to specify that these buttons should not cause validation but they have no design...
1
by: Sharon | last post by:
Hello All, Is it possible to update Sql Table through DataGrid. I have a DataGrid which is being populated through a stored procedure, all i wanted to do is to update one field...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
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: 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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.