我有一个资源文件,我读取数据并将其加载到网格视图中。现在我希望用户能够从网格中编辑并单击保存按钮,这将把它保存为resx的新文件?我该怎么做?这是读取文件的代码。
oDataSet = new DataSet();
//now am reading the files from the path that is selected
XmlReadMode omode = oDataSet.ReadXml(PathSelection);
for (int i = 0; i < oDataSet.Tables[2].Rows.Count; i++)
{
string comment = oDataSet.Tables["data"].Rows[i][2].ToString();
string font = Between(comment, "[Font]","[/Font]");
string datestamp = Between(comment, "[DateStamp]", "[/DateStamp]");
string commentVal = Between(comment, "[Comment]", "[/Comment]");
string[] row = new string[]
{
oDataSet.Tables["data"].Rows[i][0].ToString(),
oDataSet.Tables["data"].Rows[i][1].ToString(),
font,
datestamp,
commentVal
};
Gridview_Input.Rows.Add(row);
cboLanguage.Enabled = true;
btnNewfile.Enabled = true;
}
您可以尝试在每次单击按钮时刷新dataGridView。
datagridviewName.update();
datagridviewName.refresh();