473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Data Grid Check box problem

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
Oct 26 '06 #1
1 1938
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
"Stephen Plotnick" <sp*******@groupcbf.comwrote in message
news:_8******************************@giganews.com ...
>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

Oct 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jordan O'Hare | last post by:
Hello Everyone, I am after some help with the following: I have a windows application that contains a list box and two data grids. All three controls are binded to a dataset that contains...
12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
3
by: Snake | last post by:
I have a vb .net program which fills a data grid upon form load from an acccess database. This works great. Now, I have to add a combo box and use it to alter the underlying sql statement and...
2
by: Gary | last post by:
Hello All, I have an editable data grid in my web form, this grid allows the user to add new records, edit existing records and also delete them. When a user adds a record the grid goes in to...
2
by: pmud | last post by:
Hi, I am exporting data from an EDITABLE DATA GRID EXCEL. But the 1st column in data grid is Edit Column. I want to display all columns in Excel except for the Edit column. The following...
4
by: GFM GToeroe | last post by:
Hi! Actually I have to solve the following problems: Given is a dynamic set S of (moving, vanishing and arising) points (2D). It could be the case that |S|>100 or even >1000 but not >20000....
1
by: David Veeneman | last post by:
How do I get the data bindings for a control that is bound at design time? I'm binding a DataGridView control to a data source at design time, using a BindingSource control. I set the grid's...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
4
by: =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post by:
Hi All, I have an application that fetch data thru a store proc and display in a datagrid, but after successful execution of proc the data grid is not visible.Please go thru the following code...
1
by: sai dev | last post by:
Hi, I am facing problem in following scenario for WinForm Data Grid. Scenario --------- -- DepartNumber DepartmentName + 10 HR + 20 Sales
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.