private void AvailableNotesList_SelectionChanged(object sender, EventArgs e) { if (sender is DataGridView) { DataGridViewSelectedRowCollection selectedRows = (sender as DataGridView).SelectedRows; if (selectedRows != null && selectedRows.Count > 0) { DataGridViewRow selectedRow = selectedRows[0]; NoteListContent noteListContent = (selectedRow.DataBoundItem as NoteListContent); if (noteListContent != null && OnSelectDataEvent != null) { OnSelectDataEvent(noteListContent.EventData); } } } }
private NoteListContent CreateNoteFromEventData(string name, EventData eventData) { NoteListContent basicNote = new NoteListContent(); basicNote.Description = name; basicNote.NotePreview = new Bitmap(_SupportSize.X, _SupportSize.Y); var g = Graphics.FromImage(basicNote.NotePreview); var gw = m_gw; gw.UpdateGraphics(g); g.ScaleTransform(0.5f, 0.5f, MatrixOrder.Prepend); m_eventsRenderer.RenderEventDataAtInRect(gw, eventData, new Rectangle(0, 0, 90, 90), 70, 70); basicNote.EventData = eventData; return(basicNote); }
private void AvailableNotesList_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { DataGridView datagridView = sender as DataGridView; if (datagridView == null) { return; } string newLine = Environment.NewLine; if (e.RowIndex > -1) { DataGridViewRow dataGridViewRow1 = datagridView.Rows[e.RowIndex]; NoteListContent noteListContent = dataGridViewRow1.DataBoundItem as NoteListContent; if (noteListContent != null) { e.ToolTipText = noteListContent.Description; } } }