Results 1 to 1 of 1

Thread: Problem boolean column in Data Grid

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    6

    Problem boolean column in Data Grid

    One of my columns in my DataGrid is a boolean column. When adding a row via the append row the check box for this boolean will appear greyed out. This I assume means that the value stored in the dataset is null. If I change this value and leave the cell, the value for this boolean will revert back to greyed out box rather than be ticked or un-ticked. Ticked Value will only remain if I explicitly define string values for true and false... like....

    Code:
            Col9.TrueValue = "ticked"
    Is this normal????.... I just want a boolean column that saves 0 or 1 in the data set so I can handle boolean values... What am I doing wrong!??!...agggh


    I was wondering if anyone else has had a problem like this and can help!! I'm a VB.NET newbie (only 2-3 Weeks :/).. Have been struggling through Data Grids for ages!!!

    here's the code..

    Code:
            myDataSet = New DataSet("myDataSet")
            Dim theTable As DataTable
            theTable = New DataTable("theTable")
           
            Dim Col9 As DataColumn
            Col9 = New DataColumn("Col9")
            theTable.Columns.Add(Col9)
    
            Dim ts1 As DataGridTableStyle
            ts1 = New DataGridTableStyle()
            ts1.MappingName = "theTable"
            ts1.AllowSorting = False
            ts1.GridLineStyle = DataGridLineStyle.Solid
            ts1.RowHeadersVisible = False
    
            Dim Col9 As New DataGridBoolColumn()
            Col9.MappingName = "Col9"
            Col9.AllowNull = False
            Col9.Width = 40
            ts1.GridColumnStyles.Add(Col9)
    I was also wondering if there was a way of creating a default value for the boolean when the row is created. So that when a new append row appears it's either ticked or unticked....

    thanks for any help...
    Last edited by mikey.kay; Jun 3rd, 2004 at 03:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width