I sh, чтобы текст в ячейке таблицы данных переполнялся на следующий столбец / ячейку
- В столбце / ячейке никогда не будет текста, который переполняется, и если это так, то он исчезает ' t имеет значение
- Переполнение всегда слева направо слева направо
- Значение не требуется в ячейке переполнения, просто нет перекрашивания
Сегодня правая ячейка перекрашивает текст нарисовано в левом событии CellPaint
Пример:
| Col A | Col B | Col C | Col D | Col E | Col F |
-------------------------------------------------------
| | Text in col B that overflows C,D,E | |
-------------------------------------------------------
| | | Other overflow | | |
-------------------------------------------------------
Это для "просмотра календаря"
| 12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 |
--------------------------------------------------------
| | Person X - Dinner for 2 | |
--------------------------------------------------------
| | | Person Y - Lunch | | |
--------------------------------------------------------
Мой текущий метод CellPaint
private void e_gv_Kalender_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
try
{
if (e.ColumnIndex <= Kalender_maker.c_Bord || e.RowIndex < 0) return;
timeslot s = e.Value as timeslot;
if (s.Is_Booked)
{
using (Brush gridBrush = new SolidBrush(this.gv_Kalender.GridColor))
{
using (Brush backColorBrush = new SolidBrush(e.CellStyle.BackColor))
{
using (Pen gridLinePen = new Pen(gridBrush))
{
// Clear cell
e.Graphics.FillRectangle(backColorBrush, e.CellBounds);
//Bottom line drawing
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom - 1, e.CellBounds.Right, e.CellBounds.Bottom - 1);
// If first cell in booking - Draw text
if (s.is_Booking_header_cell)
e.Graphics.DrawString(s.ToString(), f, Brushes.Black, e.CellBounds.Location);
e.Handled = true;
}
}
}
}
}
catch (Exception)
{
}
}