@VAer , you could try the CellFormatting event to show integer in your datagridview.
public Form1()
{
InitializeComponent();
dataGridView1.CellFormatting += DataGridView1_CellFormatting;
}
private void DataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 3 && e.RowIndex != this.dataGridView1.NewRowIndex)
{
double d = double.Parse(e.Value.ToString());
e.Value = d.ToString("N0");
}
}
Result in database and in datagirdview:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.