Viewing DataGridBoolColumn

Hmm, i have added a column to my dataset.

    Friend WithEvents dsHistoricViewCol As System.Data.DataColumn
    Friend WithEvents dgtbHistoricViewColStyle As System.Windows.Forms.DataGridBoolColumn

When i do construct a row, i can access to my column:
 nr.Item("View") = False

But when i try resizing i get a non instancied object:
           dgHistoric.TableStyles("HistoricTable").GridColumnStyles("View").Width = 100
Adding the column (named dsHistoricVewCol)...

        Me.HistoricTable.Columns.AddRange(New System.Data.DataColumn() {Me.dsHistoricDateCol,Me.dsHistoricHourCol, Me.dsHistoricRespCol, Me.dsHistoricViewCol})
        Me.HistoricTable.TableName = "HistoricTable"

Adding the column TableStyle to list...

        Me.HistoricTableStyle.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() {Me.dgtbHistoricDateColStyle, Me.dgtbHistoricHourColStyle, Me.dgtbHistoricRespColStyle, Me.dgtbHistoricViewColStyle})

Standart column table style defenition
        Me.dgtbHistoricViewColStyle.Alignment = CType(resources.GetObject("dgtbHistoricViewColStyle.Alignment"), System.Windows.Forms.HorizontalAlignment)
        Me.dgtbHistoricViewColStyle.FalseValue = False
        Me.dgtbHistoricViewColStyle.HeaderText = resources.GetString("dgtbHistoricViewColStyle.HeaderText")
        Me.dgtbHistoricViewColStyle.MappingName = resources.GetString("dgtbHistoricViewColStyle.MappingName")
        Me.dgtbHistoricViewColStyle.NullText = resources.GetString("dgtbHistoricViewColStyle.NullText")
        Me.dgtbHistoricViewColStyle.NullValue = CType(resources.GetObject("dgtbHistoricViewColStyle.NullValue"), Object)
        Me.dgtbHistoricViewColStyle.TrueValue = True
        Me.dgtbHistoricViewColStyle.Width = CType(resources.GetObject("dgtbHistoricViewColStyle.Width"), Integer)

So coming back to my initial question, why cant I see the datagridboolcolumn ?
Who is Participating?
Bob LearnedCommented:
1) What are the values for MappingName and Width?

2) Did you set the MappingName for the DataGrid table style?

TheSonicsAuthor Commented:
Hmm, looks like it was a Visual Studio bug, the resource files has not been updated and the mapping name of my columnStyle was ViewCol instead of View.
TheSonicsAuthor Commented:
Well thanks man, it's now working. Dunno why but the UI Editor for the boolcolumn bugged and saved the wrong mappingName.

Thanks a lot for your help and the file you dropped.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.