Solved

How to Refill a tableadapter. Updated Datagridview Combobox Values

Posted on 2009-04-13
8
944 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

803 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