Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to Refill a tableadapter. Updated Datagridview Combobox Values

Posted on 2009-04-13
8
Medium Priority
?
974 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Accepted Solution

by:
brandonvmoore earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses

660 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