I've actually never manipulated data inside a DataGrid like that. I always bind my grid to a data source (like a DataSet) and manipulate the data in there. I just find it to be easier and safer. Give it a try; I think this might solve your problem.
-Pete On Mon, Jul 7, 2008 at 12:07 PM, Mike Andrews <[EMAIL PROTECTED]> wrote: > I'm trying to add a new row to the DataGridView. > > I keep getting the same error when I try to add a new DataGridViewRow: > > An unhandled exception of type 'System.InvalidOperationException' occurred > in System.Windows.Forms.dll > Additional information: Operation is not valid due to the current state of > the object. > > I have a custom list that inherits from > System.ComponentModel.BindingList<T> > where T is my custom object. > It binds just fine using a BindingSource. > > I'm using the ButtonColumn type for this grid and using each row to display > a filename. So on the click of the button (while on the New Row) I'm > showing the Open File Dialog. How can I get a new row added without > causing > this exception? > > I've tried several things but nothing seems to work. I'm sure I'm just > missing something small. > > Thanks, > Mike > > =================================== > This list is hosted by DevelopMentor(R) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com