editing data in a datagrid
- From: "tigerbalm via DotNetMonster.com" <forum@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 15 May 2005 19:57:12 GMT
Hallo!
I have filled a datagrid with data from a database. I would like to edit
the data in the datagrid and save it back to the database. My problem is
that I don't really know how to capture the event of the cell that I am
editing. The code below works but I would like to edit the data in a cell
and then for example click a button and save it.
Here is little of my code :
void Button5Click(object sender, System.EventArgs e)
{
int colNr = dataGrid4.CurrentCell.ColumnNumber;
int rowNr = dataGrid4.CurrentCell.RowNumber;
string s = dataGrid4.CurrentCell.ToString();
string currentCellData = null;
EventHandler eh = null;
currentCellData = textBox2.Text;
DataGridCell dc = new DataGridCell(rowNr, colNr);
dataGrid4[dc] = currentCellData;
}
.
- Follow-Ups:
- Re: editing data in a datagrid
- From: ClayB [Syncfusion]
- Re: editing data in a datagrid
- Prev by Date: Re: How to do non dependence on database vendor?
- Next by Date: Re: reference not removed revisited
- Previous by thread: Help with class design
- Next by thread: Re: editing data in a datagrid
- Index(es):