y.saied
پنج شنبه 22 فروردین 1392, 00:53 صبح
سلام دوستان، خیلی گشتم ولی نتوسنتم یه جواب ساده و کامل پیدا کنم
من با دستورات زیر اطلاعات بانک رو در دیتاگرید میریزم
'------------ for DataGrid
Dim Da As New OleDbDataAdapter("select * from Sanad order by sno asc", "provider=microsoft.jet.oledb.4.0; data source=" & Application.StartupPath() & "\DBase.mdb")
Dim dt As New DataTable()
Da.Fill(dt) ' براي پر کردن ديتاگريدويو
'----------------- کار با ديتاگريدويو
Dim dv As New DataView(dt)
DGView.DataSource = dv
DGView.Columns.Item(2).HeaderText = "تاریخ"
DGView.Columns.Item(3).HeaderText = "مبلغ"
DGView.Columns.Item(4).HeaderText = "شرح حساب"
DGView.Columns.Item(0).Visible = False
DGView.Columns.Item(1).Visible = False
DGView.ClearSelection() ' براي اينکه فوکاس نگيرد
dt.Dispose()
Da.Dispose()
102622
میخوام ردیف هایی رو که مبلغ آنها بصورت منفی هستش با رنگ قرمز متمایز کنم.
در ضمن بنده مبالغ رو بصورت رشته در دیتابیس ذخیره کردم.
ممنون که جواب میدین
من با دستورات زیر اطلاعات بانک رو در دیتاگرید میریزم
'------------ for DataGrid
Dim Da As New OleDbDataAdapter("select * from Sanad order by sno asc", "provider=microsoft.jet.oledb.4.0; data source=" & Application.StartupPath() & "\DBase.mdb")
Dim dt As New DataTable()
Da.Fill(dt) ' براي پر کردن ديتاگريدويو
'----------------- کار با ديتاگريدويو
Dim dv As New DataView(dt)
DGView.DataSource = dv
DGView.Columns.Item(2).HeaderText = "تاریخ"
DGView.Columns.Item(3).HeaderText = "مبلغ"
DGView.Columns.Item(4).HeaderText = "شرح حساب"
DGView.Columns.Item(0).Visible = False
DGView.Columns.Item(1).Visible = False
DGView.ClearSelection() ' براي اينکه فوکاس نگيرد
dt.Dispose()
Da.Dispose()
102622
میخوام ردیف هایی رو که مبلغ آنها بصورت منفی هستش با رنگ قرمز متمایز کنم.
در ضمن بنده مبالغ رو بصورت رشته در دیتابیس ذخیره کردم.
ممنون که جواب میدین