So I have a gridview in a windows form application and when I click my button the gridview is populated, the title column/row reads Tag (because I set it that way(below code)) but what if I wanted the Tag title to be replaced with what ever is typed in a textbox, how would I change the below code?
Tag = n.Element("GroupName").Value
Full code:
XDocument xDoc = XDocument.Load(tagUri);
var Tag = xDoc.Descendants("Group")
.Select(n => new
{
Tag = n.Element("GroupName").Value, // Tag in this line represents the column name, I would like this changed to be a textbox input.
})
.ToList();
dataGridView4.DataSource = Tag;

You can set the column’s header afterwards: