如何动态对齐列表视图中的列表视图项目。
-- 不在 XAML 中 --
lv.View = GridView
GridView.Columns.Add(New GridViewColumn With {.Header = "CrewId", .DisplayMemberBinding = New Binding("CrewId")})
GridView.Columns.Add(New GridViewColumn With {.Header = "FirstName", .DisplayMemberBinding = New Binding("FirstName")})
GridView.Columns.Add(New GridViewColumn With {.Header = "LastName", .DisplayMemberBinding = New Binding("LastName")})
GridView.Columns.Add(New GridViewColumn With {.Header = "Country", .DisplayMemberBinding = New Binding("Country")})
GridView.Columns.Add(New GridViewColumn With {.Header = "Rank", .DisplayMemberBinding = New Binding("Rank")})
Try
lv.ItemsSource = dsCrew.Tables(0).DefaultView
Catch ex As Exception
MsgBox(ex.Message)
End Try