Skip to content

How to add new line to a resource file on the gridview

Enos

Asked Feb 4, 2015, 12:15 AM EST1 answer
Share
LinkedInX
Hello Everyone,
 
Can you please help me add new row on resource file, here is the code i have used to read my resource file.
I have no idea on how to add new line... Please help 
 
 
private void btnBrowse1_Click(object sender, EventArgs e)
{
 
C#
BrowseFile();
                //versionIncrement();

                if (txtInputfile.Text.Length > 0)
                {
                    PathSelection = txtInputfile.Text;
                }
                oDataSet = new DataSet();
                //now am reading the files fro 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();
                    //the elements array contain all the columns filled
                    string[] elements = comment.Split('-'); //when it reaches the comma, it will jump to the next line
                    string font = elements[0]; //Font
                    string datestamp = elements[1]; //DateStamp
                    string commentVal = elements[2]; //Comment

                    string[] row = new string[] { oDataSet.Tables["data"].Rows[i][0].ToString(), oDataSet.Tables["data"].Rows[i][1].ToString(), font, datestamp = DateTime.Now.ToString(), commentVal };
                    Gridview_Input.Rows.Add(row);
 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    please follow these options:
    1. Get all dataset details to table
    2.  Create new row and and add to table
    3. Rebind gridview with  the table you have new row.
    0