Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: DataGridView format
Hello everybody ,
i have a problem with format , i need to change format of column when i get records from my bank(access) , i use code like this but didnt word :
da.SelectCommand = New OleDbCommand()
        With da.SelectCommand
            .Connection = my_con
            .CommandType = CommandType.Text
            .CommandText = "Select p_name,p_fname,p_mablagh from table1"
            If .Connection.State <> ConnectionState.Open Then
            End If
        End With
        Dim ds As New Database2DataSet
        Me.DataGridView1.DataSource = ds.Table1
        Me.DataGridView1.Columns(2).DefaultCellStyle.Format = "##,0"

this is my datagridview now :
((value of column2 show like 12000 but i dont like it i want to show like 12,000))
but i want to change format of column2 like this pic :

((value of column2 show like 12000 but i dont like it i want to show like 12,000))
*** i get record from bank
please help me
Posted 16-Mar-12 2:04am
Edited 16-Mar-12 2:06am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 230
1 PIEBALDconsult 150
2 DamithSL 125
3 BillWoodruff 108
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195

Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 16 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100