Currency format in DataGridView in windows application

后端 未结 6 2023
一个人的身影
一个人的身影 2021-01-13 06:55

i am unable to show currency format on DataGridView. Can you people look this code.

private void dataGridView1_DataBindingComplete(object sender,
                    


        
6条回答
  •  伪装坚强ぢ
    2021-01-13 07:43

    Try adding the code @Pranay Rana suggested into the CellFormatting Event on the DataGridView:

    private void NameOfYourGridGoesHere_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
    {
        this.NameOfYourGridGoesHere.Columns["UnitPrice"].DefaultCellStyle.Format = "c";
    }
    

提交回复
热议问题