private void levelGrid_SelectionChanged(object sender, EventArgs a) { richTextBoxLTLevelInfo.Clear(); DataGridView dgv = sender as DataGridView; int level = LevelGrids.IndexOf(dgv); if (dgv.SelectedRows.Count == 0) { return; } int row = dgv.SelectedRows[0].Index; richTextBoxLTLevelInfo.AppendText(Attributes[level][row].GetAnotation()); }
private void levelGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs args) { // colouring changes between levels DataGridView dgv = sender as DataGridView; int level = LevelGrids.IndexOf(dgv); if (AttributesChange.Count == 0) { return; } if (AttributesChange[level].Contains(args.RowIndex)) { args.CellStyle.BackColor = Color.LightGreen; } // set tooltip text /*int row = args.RowIndex; * int column = args.ColumnIndex; * dgv.Rows[row].Cells[column].ToolTipText = Attributes[level][row].GetAnotation();*/ }