I've been figuring out how to insert data directly on the datagrid. It's like when I click on a row, I can edit it or add another just by clicking on that specific row and then update it. Can someone help me do this? I've search the net and what I got in the codeproject website was not complementing with my VS 2005, so I need an alternative.

Here's the code from codeproject:

int this.iRowIndex = 0;        

          private void fnInsertNew()
		 //keep in mind the previous clicked row to unselect
		 int iPrevRowindex=this.iRowIndex;
		 MessageBox.Show("Enter the new record at the end of the DataGrid and click 'Save/Update'-button", "Stop");		  
		 //get how many records in the table
		  //select the last row
		 //unselect the previous row

This doesn't seem to work for me for the fact that "Unselect()" method does not exist in my intellisense. Also when I use ".Select(iRowIndex)" it gets an error that it says it cannot have any arguments or the Select method has 1 argument. Can anyone help me with this?

8 Years
Discussion Span
Last Post by mzd12111

i want to design a mailbox(in windows application mode) so i need to draw a table (in fact a matrix ) which the Columns are "Sender" and "Subject" and the rows are different mails received.
but i cant figure out how to draw a table on the screen , and bind it firstly and for test to some data which are i enter and finally to a database which is store the mails info.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.