I'm trying to use a windows forms datagrid (.NET 1.1) to update the elements of a two dimensional array. Using the microsoft documentation, I've been able to get the datagrid to display the array properly.
EDIT: The MS instructions I followed are at http://support.microsoft.com/kb/315786.
class myrow {
private int a, b;
public int A {get { return a; } set {a = value;}}
public int B {get { return b; } set {b = value;}}
}
myrow[] myRows = new myrow[5] {
new myrow(3,2),
new myrow(2,2),
new myrow(1,2),
new myrow(3,3),
new myrow(3,1),
}
myDataGrid.SetDataBinding(myRows, "");
I've also got the DataGrid's TableStyle.MappingName property set to "myrow[]"
.
What's been driving me crazy is that I can't update it. I enter a new value in a cell on the form, say "1123", and hit enter or tab, and the cursor moves to the next cell and the value changes back to the original value.
How can I get it to take the updates?