Hi Everyone,
I am new here.
I am currently working on a resource file using windows form. I have a browse button which the user will browse resource file and it get loaded into the Grid-view of which it is working. I also have a button called New, for the user to click new the file must first be loaded on the first grid-view. when new button is clicked it loads the file to the second grid-view. now my questions are as follows
1.How do i load the second grid without the values on it?
2.How can i add new row from the grid-view and it get loaded after you save(if new row/line created it must all ad new block on xml). i hpoe i am clear enough
my code which browse and loads the file to the gridview.
private void btnBrowse1_Click(object sender, EventArgs e)
{
try
{
BrowseFile();
string PathSelection = "";
if (txtInputfile.Text.Length > 0)
{
PathSelection = txtInputfile.Text;
}
oDataSet = new DataSet();
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;
}
}