JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser .
Data Grid Check box problem
Thread starter
Thread starter
Stephen Plotnick
Start date
Start date
Oct 26, 2006
I have a checkbox in a data grid that does not change it's state until I
actually leave the field. I've done this routine several times in other data
grids without an issue.
I'm using VB.2003.
Steve
Strange thing; I moved the column to another column and it works as
expected. I really need the column where I had it before.
I move the column from the last column to the first to make it work.
Here is the code:
'
' Create GridColumnStyle objects for the grid columns
'
Dim aCol1 As New DataGridTextBoxColumn
Dim aCol1a As New DataGridTextBoxColumn
Dim aCol2 As New DataGridTextBoxColumn
Dim aCol3 As New DataGridTextBoxColumn
Dim aCol5 As New DataGridTextBoxColumn
Dim aCol6 As New DataGridTextBoxColumn
Dim aCol7 As New DataGridTextBoxColumn
Dim aCol8 As New DataGridTextBoxColumn
Dim aCol9 As New DataGridTextBoxColumn
Dim aCol10 As New DataGridTextBoxColumn
Dim aCol11 As New DataGridTextBoxColumn
Dim aCol11a As New DataGridTextBoxColumn
Dim aCol12 As New DataGridTextBoxColumn
Dim aCol13 As New DataGridTextBoxColumn
Dim aCol14 As New DataGridTextBoxColumn
Dim aCol15 As New DataGridBoolColumn
'
' Set column's caption, width and disable editing.
'
With aCol1
..HeaderText = "Product SKU"
..MappingName = "ProductSKU"
..Width = 65
..Alignment = HorizontalAlignment.Left
..TextBox.Enabled = False
End With
With aCol1a
..HeaderText = "Description"
..MappingName = "InvoiceDescripton"
..Width = 203
..Alignment = HorizontalAlignment.Left
..TextBox.Enabled = False
End With
With aCol2
..MappingName = "CurrentRNB"
..HeaderText = "Cur RNB"
..Width = 54
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = False
End With
With aCol3
..MappingName = "FutureRNB"
..HeaderText = "Fut RNB"
..Width = 54
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = False
End With
With aCol5
..MappingName = "RNBPctchg"
..HeaderText = "RNB % Chg"
..Width = 66
..Alignment = HorizontalAlignment.Right
..Format = "p"
..TextBox.Enabled = False
End With
With aCol6
..MappingName = "CurrentPallet"
..HeaderText = "Cur Pallet"
..Width = 56
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = False
End With
With aCol7
..MappingName = "FuturePallet"
..HeaderText = "Fut Pallet"
..Width = 56
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = False
End With
With aCol8
..MappingName = "DollarChangePallet"
..HeaderText = "Pallet $ Chg"
..Width = 75
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = False
End With
With aCol9
..MappingName = "PalletPctchg"
..HeaderText = "Pal % Chg"
..Width = 60
..Alignment = HorizontalAlignment.Right
..Format = "p"
..TextBox.Enabled = False
End With
With aCol10
..MappingName = "SuggestedDIY"
..HeaderText = "MSRP"
..Width = 55
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = False
End With
'With aColxx
'.MappingName = "SuggestedContractor"
'.HeaderText = "S/R Contr"
'.Width = 68
'.Alignment = HorizontalAlignment.Right
'.Format = "c"
'.TextBox.Enabled = False
'End With
With aCol11a
..MappingName = "ReplacementCost"
..HeaderText = "Store Cost*"
..Width = 70
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = True
End With
With aCol12
..MappingName = "StoreCost"
..HeaderText = "Cost w/Tint*"
..Width = 73
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = True
End With
With aCol13
..MappingName = "StoreRetail"
..HeaderText = "Store Retail*"
..Width = 73
..Alignment = HorizontalAlignment.Right
..Format = "c"
..TextBox.Enabled = True
End With
With aCol14
..MappingName = "DesiredMargin"
..HeaderText = "Margin*"
..Width = 55
..Alignment = HorizontalAlignment.Right
..Format = "p"
..TextBox.Enabled = True
End With
With aCol15
..MappingName = "OmitFlag"
..HeaderText = "Omit*"
..Width = 35
..AllowNull = False
..NullValue = False
..Alignment = HorizontalAlignment.Center
End With
'
' Add the GridColumnStyles to the DataGrid's Column Styles collection.
'
With aGridTableStyle.GridColumnStyles
..Add(aCol15)
..Add(aCol1)
..Add(aCol1a)
..Add(aCol2)
..Add(aCol3)
..Add(aCol5)
..Add(aCol6)
..Add(aCol7)
..Add(aCol8)
..Add(aCol9)
..Add(aCol10)
'.Add(aCol11)
..Add(aCol11a)
..Add(aCol12)
..Add(aCol13)
..Add(aCol14)
End With
'
' Add the GridColumnStyles to the aGridTableStyle.
'
DataGrid1.TableStyles.Add(aGridTableStyle)
DataGrid1.CurrentCell = New DataGridCell(0, 10)
'DataGrid1.DataSource.DefaultView.AllowNew = False
HoldValue = DataGrid1.Item(0, 10)
Steve