I have a DatagridView in my application. I want to serialize the gridview columns into a XML-file. Serializing just the columns name is easy but I want to serialize the columns index too.
Serializing the columns would I do like this:
ArrayList array = new ArrayList();
foreach(DataGridViewColumn column in datagridView1.Columns)
{
array.Add(column.Name)
}
using (FileStream file = new FileStream("test.xml", FileMode.Create))
{
SoapFormatter formatter = new SoapFormatter();
formatter.Serialize(file, array);
}
But I´m wondering how can I serialize the column index too?
Thanks in advance for any help!
XmlFormatter??