views:

4081

answers:

5

Baby steps rolling... I have a form with a data grid bound to a table. I have some textboxes on the form bound to the table[columns], so as I scroll the grid, the textboxes show corresponding data.

I go to an "Edit Mode" of the textboxes and change the content and hit a save button. The grid doesn't refresh the changed context until I physically click in the cell which forces a call to the tables OnChanging and OnChanged events...

How can I FORCE whatever event to "flush" the table at the end of my edit and have it refreshed in the datagridview.

Thanks

+1  A: 

Are you using a BindingSource? If so, call its EndEdit method on the TextBox's Leave event.

Jay Riggs
No impact. Both the grid (obviously), and the textboxes are bound to the DataTable instance, but appears I cant' force throw the Tables "OnChanging" / "OnChanged" event which is what happens when I re-click in the grid manually after saving an edit.
DRapp
+2  A: 

Have you tried calling the dataGridView's Invalidate method?

this.dataGridView1.Invalidate();
BFree
My bad. The form level's "Click" event of the button was never being fired directly since I had used a custom class that had a default method behavior. After adjusting that as needed, it works perfectly... However, I did InvalidateROW for the one record in question. Thanks
DRapp
A: 

don't refresh Invalidate() method!

A: 

it does not :( i think i can't it....Puffffffffffffff

A: 

How about putting your code that loads the data into the control into a separate method then setting the visibility to public or internal and calling that method.

ParentFormType parent = (ParentFormType)this.owner; parent.publicmethodtorefreshsetdatagrid()

Richard Fremmerlid - MCPD