Completed
Last Updated: 06 Apr 2012 03:24 by ADMIN
ADMIN
Stefan
Created on: 06 Apr 2012 03:24
Category: GridView
Type: Bug Report
1
FIX. RadGridView - exception when loading saved layout from a MemoryStream
To reproduce:
public Form1()
{
InitializeComponent();
Random r = new Random();
DataTable table = new DataTable();
table.Columns.Add("ID", typeof(int));
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Bool", typeof(bool));
table.Columns.Add("DateColumn", typeof(DateTime));
for (int i = 0; i < 10; i++)
{
table.Rows.Add(i, "Row " + i, r.Next(10) > 5 ? true : false, DateTime.Now.AddHours(i));
}
this.radGridView1.DataSource = table;
radGridView1.Columns[0].FormatString = "{0:n3}";
}
MemoryStream ms = new MemoryStream();
private void radButton1_Click(object sender, EventArgs e)
{
// ms.SetLength(0); reset memory stream to save new layout
radGridView1.SaveLayout(ms);
}
private void radButton2_Click(object sender, EventArgs e)
{
radGridView1.LoadLayout(ms);
}
}
0 comments