MarkItZero
Freshman
Hello,
I will admit that I am a lousy VB.Net programmer, but when the boss says get it done, it seems I dont have much choice.
I am creating a windows program using data from an Access database. I thought my best bet would be to use datagrids on my form for inserting, editing and deleting data from the tables. When I used the datagrid wizard to create my form I expected I would find a lot of the same functionality that I would find if I just opened the table in Access. Sadly this is not the case.
I especially wanted to be able to copy and paste rows just like I would in Access or Excel. But I have no idea where to start.
I also need to find a way to add combo boxes to my datagrid.
Lastly, I have added a checkbox column to the datagrid, but it is behaving strangely. Sometimes when I click the box, nothing happens. Other times I will click the box and a dim grey check mark will appear instead of the usual bold black mark.
This is the code that I used to set my datagrid properties everything else on the form was generated by the wizard...
Any suggestions for any of my problems would be greatly appreciated.
Thanks!
I will admit that I am a lousy VB.Net programmer, but when the boss says get it done, it seems I dont have much choice.
I am creating a windows program using data from an Access database. I thought my best bet would be to use datagrids on my form for inserting, editing and deleting data from the tables. When I used the datagrid wizard to create my form I expected I would find a lot of the same functionality that I would find if I just opened the table in Access. Sadly this is not the case.
I especially wanted to be able to copy and paste rows just like I would in Access or Excel. But I have no idea where to start.
I also need to find a way to add combo boxes to my datagrid.
Lastly, I have added a checkbox column to the datagrid, but it is behaving strangely. Sometimes when I click the box, nothing happens. Other times I will click the box and a dim grey check mark will appear instead of the usual bold black mark.
This is the code that I used to set my datagrid properties everything else on the form was generated by the wizard...
Code:
'Set Datagrid Properties
'New Table Style
Dim TSeditEquip As New DataGridTableStyle
'Table Style Properties
With TSeditEquip
.MappingName = "Equipment"
End With
'Declare Each Column of DG
Dim col1 As New DataGridTextBoxColumn
Dim col2 As New DataGridTextBoxColumn
Dim col3 As New DataGridTextBoxColumn
Dim col4 As New DataGridBoolColumn
'Column Properties
With col1
.HeaderText = "Equip Code"
.MappingName = "EquipCode"
.Width = 100
.TextBox.MaxLength = 15
.NullText = String.Empty
End With
With col2
.HeaderText = "Type"
.MappingName = "EquipType"
.Width = 150
End With
With col3
.HeaderText = "Description"
.MappingName = "Description"
.Width = 250
.TextBox.MaxLength = 25
.NullText = String.Empty
End With
With col4
.HeaderText = "Inactive"
.MappingName = "Inactive"
.Width = 60
End With
'Add Columns to DataStyle
TSeditEquip.GridColumnStyles.AddRange(New DataGridColumnStyle() {col1, col2, col3, col4})
'Add DataStyle to DG
grdEquipment.TableStyles.Add(TSeditEquip)
Any suggestions for any of my problems would be greatly appreciated.
Thanks!