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

Refreshing Datagridview C#

12
Hi,
I know this question has been asked many many times and I think I found the answer to this question to be to rebind the dataset. But my question is where do I do this. I have a main form that has a datagridview that displays data from an access database. I have three buttons to create a new entry edit and entry and close an entry. So where do I rebind the dataset after I have completed one of these tasks. I also have this set up as a strongly typed dataset if that helps.
Thanks a bunch.
Apr 9 '07 #1
3 4968
Hi

Create a method for doing databinding and call this method inside click event of each button

Regards
TeenzoneZ
Apr 9 '07 #2
twigboy
12
So this is what I have for the databinding method
Expand|Select|Wrap|Line Numbers
  1. public void Refresh()
  2.         {
  3.             unitTableDataGridView.DataSource = unitTableBindingSource;
  4.         }
  5.  
I the call this in my edit button click event.
my edit button click opens another form to edit the currently selected row.
Even after I updated the database it still does not show in the datagridview. Am I missing something else?
Apr 9 '07 #3
nmsreddi
366 256MB
Hello

There is no need of calling the databing in all button clicks ,but when ever you are updating your database (i.e entering new data at run time ) after saving data in database you can rebind your grid view thats all the updated data will be binded again to the grid view .

Try it out ,it works fine
Apr 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: RSH | last post by:
I have a situation where I have a Master form that contains a DataGridView. Each row has a details... button that spawns a new winform which shows many more fields than the DataGridView. The user...
0
by: Bob | last post by:
I have relational integrity set up in my sql server 2005 database that prevents cascading deletes in some cases. I'm using a bound datagrid view and a tablenavigator. When I click the delete...
1
by: Steve | last post by:
I have a bound DataGridView. When I add an item to the DataSource, the DataGridView won't reflect the new row. I have googled and googled, no solution that I have found online works. One thing...
1
by: Greg | last post by:
I'm using a DataGridView object bound to an xml datasource. I have added 2 unbound columns which are populated based on the calculations of data from other columns. When the data in the other...
3
by: steve | last post by:
Hi All How can I get the datagridview to redraw after changing the rowtemplate.height at runtime ( it is databound to a datatable) I have tried datagridview1.refresh etc to no avail (The row...
0
by: lv2compute | last post by:
I am having a problem with my datagridview. I have a small table that has two columns. The first column is bound to my dataset. The second column is a combobox. I add items to the combobox based on...
1
by: romerve | last post by:
Hello; i am having some problems trying to get a form that has a datagridview to refresh after a new record is created. I have a MDI container and menu form and add new record form; the menu...
1
by: Arved Sandstrom | last post by:
This seems to be something so simple that none of the hundred-odd tutorials and forum threads that I have looked at (:-)) apparently thinks it's a problem. In a nutshell, I have two...
0
by: enrico via DotNetMonster.com | last post by:
as a way of refreshing my datagridview i rerun my query after every command. on my delete button i use the same procedure but as a result it will clear all the results. can anyone help me how to...
1
by: Andrus | last post by:
I have Winforms DataGridView whose DataSource Rids is Marc sample TableListCollection<TRowderived from BindingList. It is used to edit invoice rows. If user presses Revert button, my application...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
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.