0
Reply

How can i edit a cell from the datgridview?

Enos

Enos

Feb 10 2015 1:56 AM
483
Good Morning,
 
I have asked this question yesterday and i didn't get good response. i am working on a resx file. I have read the file and load it on data-gridview. now i wanted to be able to edit from the file and save.I have tried many ways but i didn't come with the solution. yesterday i tried this code below. I don't know how i can edit. please help me.



private
void btnSave_Click(object sender, EventArgs e) {   foreach (DataGridViewRow _row in Gridview_Output.Rows) { DataRow dt1 = oDataTable.NewRow(); for (int i = 0; i < Gridview_Output.ColumnCount; i++) { Gridview_Input.SelectedRows[0].Cells[1].Value = oDataSet.Tables["data"].Rows[0][1].ToString(); Gridview_Input.SelectedRows[0].Cells[2].Value = oDataSet.Tables["data"].Rows[0][2].ToString(); Gridview_Input.SelectedRows[0].Cells[3].Value = oDataSet.Tables["data"].Rows[0][3].ToString(); Gridview_Input.SelectedRows[0].Cells[4].Value = oDataSet.Tables["data"].Rows[0][4].ToString(); oDataTable.Rows.Add(dt1); } oDataSet.Tables.Add(oDataTable); oDataSet.WriteXml(PathSelection); }