Remove specific datagrid tablestyle

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

is it possible to remove just a specific tablestyle and keep anyothers that
may exist? I've got the folowing code:

Dim TS As New DataGridTableStyle
TS.MappingName = "ABQTG0UN"

......

Datagrid1.TableStyles.Add(TS)

......
If (Datagrid1.TableStyles.Contains("ABQTG0UN") = True) Then
Datagrid1.TableStyles.Remove(TS)
 
Are you sure this isn't working? I have this code typed into an empty form
and the tablestyle.count goes to 1 then back to 0. Maybe your doing
something else we are not seeing?

Dim TS As New DataGridTableStyle
Dim DataGrid1 As New DataGrid
TS.MappingName = "ABQTG0UN"
Datagrid1.TableStyles.Add(TS)
If (Datagrid1.TableStyles.Contains("ABQTG0UN") = True) Then
Datagrid1.TableStyles.Remove(TS)
End If

Chris
 
Back
Top