>' Load DataGrid >Me.dgSearchResult.DataSource = myDS.Tables("Search") >Me.dgSearchResult.ReadOnly = True >Me.dgSearchResult.AllowNavigation = False >Me.dgSearchResult.AllowSorting = False > >' Now, Add the new DataGrid view >Call MyAddCustomDataTableStyle_Search() > >Private Sub MyAddCustomDataTableStyle_Search() > ' Make new DataTableStyle for DataGrid > Dim ts As New DataGridTableStyle() > ts.MappingName = "Search" > ts.ReadOnly = True > ts.AllowSorting = False > ts.AlternatingBackColor = Color.LightYellow > > Dim TextCol1 As New DataGridTextBoxColumn() > TextCol1.MappingName = "EmployeeID" > TextCol1.HeaderText = "EmployeeID" > TextCol1.Width = 65 > TextCol1.NullText = "" > > ts.GridColumnStyles.Add(TextCol1) > > Dim TextCol2 As New DataGridTextBoxColumn() > TextCol2.MappingName = "Name_e" > TextCol2.HeaderText = "English Name" > TextCol2.Width = 150 > TextCol2.NullText = "" > > ts.GridColumnStyles.Add(TextCol2) > > Dim TextCol3 As New DataGridTextBoxColumn() > TextCol3.MappingName = "Name_a" > TextCol3.HeaderText = "Arabic Name" > TextCol3.Width = 150 > TextCol3.NullText = "" > > ts.GridColumnStyles.Add(TextCol3) > > Dim TextCol4 As New DataGridTextBoxColumn() > TextCol4.MappingName = "CivilID" > TextCol4.HeaderText = "Civil ID" > TextCol4.Width = 90 > TextCol4.NullText = "" > > ts.GridColumnStyles.Add(TextCol4) > > ' Add the TableStyle to the original DataGrid > Me.dgSearchResult.TableStyles.Add(ts) >End Sub >>