void portGrid_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { RdmNetEndPoint endpoint = portGrid.Rows[e.RowIndex].DataBoundItem as RdmNetEndPoint; if (endpoint != null) { if (e.ColumnIndex == portGrid.Columns["Patched"].Index) { if (endpoint.AcnUniverse == 0) { endpoint.AcnUniverse = endpoint.Universe; } else { endpoint.AcnUniverse = 0; } } if (e.ColumnIndex == portGrid.Columns["Identify"].Index) { endpoint.Identify = !endpoint.Identify; } } } }
void portGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.RowIndex < 0) return; RdmNetEndPoint endpoint = portGrid.Rows[e.RowIndex].DataBoundItem as RdmNetEndPoint; if (endpoint != null) { if (e.ColumnIndex == portGrid.Columns["Identify"].Index) e.Value = endpoint.Identify ? "On" : "Off"; } }