Remove specific datagrid tablestyle

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)
 
C

Chris, Master of All Things Insignificant

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top