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....
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!??!...aggghCode:Col9.TrueValue = "ticked"
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..
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....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)
thanks for any help...![]()


Reply With Quote