Solved

How to Refill a tableadapter. Updated Datagridview Combobox Values

Posted on 2009-04-13
8
964 Views
Last Modified: 2012-05-06
In my DatagridView I have a combobox with a list of values.
also outside the grid there is a button that opens a form where you can add new values .
i want when i close the form the new values to be added in the datagridview combobox .
the form and the combobox are binded to the same dataset..
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 5

Expert Comment

by:brandonvmoore
ID: 24135857
I really don't use the DGV, but I'll see if I can help you .  I would imagine that there's some kind of method to update or refresh the DGV.  When the new value is added from the popup form, have it also update the DGV on the main form.

Let me know if that helps.
0
 
LVL 5

Expert Comment

by:brandonvmoore
ID: 24135886
By the way, when you make changes on the popup form:  is the database being update and you just can't figure out how to get the DGV to refresh, or are you even getting the database updated?

Here's a similar post by someone else that may help:
http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/2374a1a1-ab71-4895-850e-4357346397de
0
 
LVL 18

Author Comment

by:John (Yiannis) Toutountzoglou
ID: 24135912
i just want to update only the combobox of the datagridview ...
on the popup form i have an update button tha saves the new data in the dataset.
.keep in mind that the combobox has the same dataset...
if close the dgv and open it again i have the new data in the combobox...but i need to accomplish this at runtime
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 5

Accepted Solution

by:
brandonvmoore earned 500 total points
ID: 24135951
0
 
LVL 18

Author Comment

by:John (Yiannis) Toutountzoglou
ID: 24135991
i will read it immediatelly
0
 
LVL 18

Author Comment

by:John (Yiannis) Toutountzoglou
ID: 24136259
so what i'va done is the following after closing the popup form.and it works properly.So three lines for three weeks stuck.
thank you for guide me.
plz give me your opinion about doing something like this
            MyDataGridView.EndEdit()
            Me.MyTableAdapter.Fill(MyDataSet.MyTable)
            MyDataGridView.Refresh()

Open in new window

0
 
LVL 5

Expert Comment

by:brandonvmoore
ID: 24142495
Yeah, that looks good to me.  Besides, if it works it works, right?

It might be more ideal if there were a way that you could just update what you needed instead of filling the entire thing again, but as long as performance is ok then I certainly wouldn't which I'm sure it's not then I wouldn't worry about that at all.
0
 
LVL 18

Author Comment

by:John (Yiannis) Toutountzoglou
ID: 24145501
yes it works fine ...
as for the theory of the table adapter i think i can use the function "fill" any time i want without changing the performance ...i am trying to find ,just for knowledge, another way to accomplish this but i can't find a different solution ....thanx for for guiding me...
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month6 days, 23 hours left to enroll

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question