C datagridview bound to datatable not updating

Then, I added a second button, which when clicked, adds another column to the underlying Data Table.When I tested it, and I clicked the second button, the grid immedialtey reflected the update.Invoke method to marshal the manipulating to the GUI control from another thread. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights Hi Jeffrey, Thanks, your suggestion works. Below is my modified sample code snippet: Data Table dt; private void Form1_Load(object sender, Event Args e) void fsw_Created(object sender, File System Event Args e) private void button1_Click(object sender, Event Args e) This code snippet works well on my side. I no longer needs to manually refresh or Reset Bindings the Data Grid View. Reset Bindinds(true); Kinda old topic, but since it bugged me, I decided to share my experience...Binding the source didn't work for me and Datagridview doesn't have "Main View" variable.

At runtime, I then added some values to the first Data Grid View, and when I clicked the button to bring up the dialog, the changes were reflected. Mark may be right when he suggested you check if Data Table table = new Data Table(); public Form1() private void button1_Click(object sender, Event Args e) private void button2_Click(object sender, Event Args e) private void button3_Click(object sender, Event Args e) public partial class Grid Viewer : Form //just has a Data Grid View on it Is Auto Generate Columns set to true?

I have written a sample project regarding your scenario, however, it works well on my side: Data Table dt; private void Form1_Load(object sender, Event Args e) private void button1_Click(object sender, Event Args e) When I clicked Button1 to add a new row to the Data Table, the Data Grid View refresh the update immediately. Best regards, Jeffrey Tan Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.

I have attached my sample project in this reply for your reference. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights Hi George, Thanks for your feedback information!

From the answer in Force WPF Data Grid to regenerate itself, Andres suggested setting I had the same issue and I issued a Data Bind().

It's not the silver bullet for everything, but it's what helped me in a few cases.

Leave a Reply

  1. dating a scorpio man 02-Nov-2020 03:59

    Plus, unlike other free Christian dating websites in the UK, eharmony won’t make you spend hours scrolling through profiles, searching for that someone special.