K
KC
Why would the code below fail? I'm making a tablestyle, which works fine. I
test to see if the style already exist for this datagrid, if it does, remove
it before adding the new version. What I don't understand is the 'Contains'
method. I get different answers depending on whether I use:
dgNC.TableStyles.Contains(dgtsNC) or
dgNC.TableStyles.Contains(dgtsNC.MappingName)
I guess I just don't get this tablestyles thing.
-------------------------
Dim dgtsNC As New DataGridTableStyle
Dim dgNC as DataGrid = DataGrid1
...
create a table style
...
If dgNC.TableStyles.Contains(dgtsNC) Then
dgNC.TableStyles.Remove(dgtsNC)
Next
dgNC.TableStyles.Add(dgtsNC)
Ken
test to see if the style already exist for this datagrid, if it does, remove
it before adding the new version. What I don't understand is the 'Contains'
method. I get different answers depending on whether I use:
dgNC.TableStyles.Contains(dgtsNC) or
dgNC.TableStyles.Contains(dgtsNC.MappingName)
I guess I just don't get this tablestyles thing.
-------------------------
Dim dgtsNC As New DataGridTableStyle
Dim dgNC as DataGrid = DataGrid1
...
create a table style
...
If dgNC.TableStyles.Contains(dgtsNC) Then
dgNC.TableStyles.Remove(dgtsNC)
Next
dgNC.TableStyles.Add(dgtsNC)
Ken