Answer the question
In order to leave comments, you need to log in
How to set up dataGridView in visual studio?
I don't know what the names of the individual elements are.
I will explain as best I can.
data binding is not
needed, just a table without an additional line of the last line and markers in the form of an asterisk and an arrow,
changing any cell at any time, now if I create (conditionally) 3 columns and 3 rows, then it does not allow me to enter data
, perhaps I wrote it is not clear, it will be easier for me to answer leading questions
removed the bottom line
editing also did it
remains to remove the arrow
DataGrid.AllowUserToAddRows = false;
dataGridView1.Rows[i].ReadOnly = false;
Answer the question
In order to leave comments, you need to log in
solved
private void Dgv_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex == -1 && e.RowIndex > -1)
{
object o = (sender as DataGridView).Rows[e.RowIndex].HeaderCell.Value;
e.PaintBackground(e.CellBounds, true);
using (SolidBrush br = new SolidBrush(Color.Black))
{
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
e.Graphics.DrawString(o.ToString(),
e.CellStyle.Font, br, e.CellBounds, sf);
}
e.Handled = true;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question