0
我想從WinForms轉換爲WPF,並且掙扎了一下DataGridView - > WPF DataGrid。WPF DataGrid'CellFormatting Equivalent'
我已經加載好所有的數據,只是卡在單元格格式。
有一列有數字,但如果數字爲零,而不是顯示0,我希望它顯示NIL。
隨着DataGridView中,下面的工作
Private Sub SampleDGV_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles SampleDGV.CellFormatting
Try
If e.RowIndex >= 0 And e.ColumnIndex = SampleDGV.Columns(CostColumn.Name).Index Then
If CDec(e.Value.ToString) = 0 Then
e.Value = "NIL"
e.FormattingApplied = True
End If
End If
Catch ex As Exception
End Try
End Sub
但現在我難倒了WPF相當於
感謝隊友,工作完美。 – 2011-04-14 02:21:49