Solved

How to Refill a tableadapter. Updated Datagridview Combobox Values

Posted on 2009-04-13
8
937 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
  • 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
 
LVL 5

Accepted Solution

by:
brandonvmoore earned 500 total points
ID: 24135951
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now