| | |
inserting new data into datagrid
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2008
Posts: 31
Reputation:
Solved Threads: 0
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:
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?
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");
this.btInsertnew.Enabled=false;
//get how many records in the table
this.iRowIndex=this.dataSet11.Tables["MyContactsTable"].Rows.Count;
//select the last row
this.dataGrid1.Select(this.iRowIndex);
//unselect the previous row
this.dataGrid1.UnSelect(iPrevRowindex);
}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?
•
•
Join Date: Nov 2006
Posts: 48
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- Displaying # value in date field in a data grid. (VB.NET)
- Datagrid Help (VB.NET)
- Inserting data in database (VB.NET)
- Datagrid - no value at index ### error when scroll and sort (VB.NET)
Other Threads in the C# Forum
- Previous Thread: enable button on other form
- Next Thread: how to convert Pdf to word
| Thread Tools | Search this Thread |
.net access ado.net algorithm array backup barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime decryption degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest i18n image imageprocessing index input install java label list listbox listener mandelbrot math microsystems mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer update uploadatextfile usercontrol users validation view visualstudio webbrowser whileloop windows winforms wpf xml





