WPF下DataGrid的简单应用

 Dim dt As New DataTable()
        '-------------------
        dt.Columns.Add(New DataColumn("名称"))
        dt.Columns.Add(New DataColumn("说明"))
        dt.Columns.Add(New DataColumn(""))
        '-------------------
        Dim dr1 As DataRow
        dr1 = dt.NewRow()
        dr1(0) = "11111111111111111111"
        dr1(2) = "2222222222222"
        dr1(1) = "3333333333333333"
        dt.Rows.Add(dr1)
        Dim dv As New DataView(dt)
        DataGrid1.ItemsSource = dv
        DataGrid1.Columns(0).Width = 200
        DataGrid1.Columns(1).Width = 400
        DataGrid1.Columns(2).Width = 250

       

 

posted @ 2015-12-06 16:39  早一步是财富  阅读(312)  评论(0编辑  收藏  举报