Link to home
Start Free TrialLog in
Avatar of TheSonics
TheSonics

asked on

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
        'dgtbHistoricViewColStyle
        '
        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 ?
Avatar of TheSonics
TheSonics

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.