문제

i have a datagridview the contents are as follows when i load the datagridview

enter image description here

for the column Payment ID i want the IDs to be like P00001 i know i have to use the mask \P99999 but the question is how? any help would be appreciated thanks in advance.. and the input mask in the access database from where i'm importing the data is \P99999;;#

도움이 되었습니까?

해결책

E.g.

Dim table As New DataTable

With table.Columns
    .Add("Formatted", GetType(Integer))
    .Add("Unformatted", GetType(Integer))
End With

With table.Rows
    .Add(1, 1)
    .Add(2, 2)
    .Add(3, 3)
End With

Me.DataGridView1.DataSource = table
Me.DataGridView1.Columns(0).DefaultCellStyle.Format = "\P00000"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top