class EditableItem {
// Constructor
public EditableItem(int width, int height, int etCetera){
_Width = width;
_Height = height;
_EtCetera = etCetera;
}
// Expose data to edit as properties
int _Height;
public int Height{ get{ return _Height;} set {_Height = value;} }
int _Width;
public int Width{ get{ return _Width;} set {_Width = value;} }
int _EtCetera;
public int EtCetera{ get{ return _EtCetera;} set {_EtCetera = value;} }
}
public void EditItem(int index1, int index2) {
// Create an object with the data to edit
EditableItem i = new EditableItem(
Heights[index1, index2],
Widths[index1, index2],
EtCeteras[index1, index2]);
// Present the user with the data in the property grid
MyPropertyGrid.SelectedObject = i;
// At some point you will need to save the previously selected item's data
// back to the arrays. A good time to do this would be immediately before
// a new item is selected.
}